Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for path prefix replacement #15

Closed
Farigh opened this issue Jan 21, 2021 · 0 comments · Fixed by #17
Closed

Add support for path prefix replacement #15

Farigh opened this issue Jan 21, 2021 · 0 comments · Fixed by #17
Labels
enhancement New feature or request
Milestone

Comments

@Farigh
Copy link
Owner

Farigh commented Jan 21, 2021

Sometimes the backtrace could contain paths that are not relevant in the report (too long or environment dependent path for example).

The idea would be to allow users to define prefixes, optionally with a possible replacement.

For example, the following report:

==1== Conditional jump or move depends on uninitialised value(s)
==1==    at 0x10101042: myFunc() (/a/directory/path/on/my/machine/myotherprojectsrc/mylibs/lib1/MyClass.cpp:14)
==1==    by 0x10101042: main (/a/directory/path/on/my/machine/myprojectsrc/main.cpp:34)
==1==  Uninitialised value was created by a stack allocation
==1==    at 0x10101042: myFunc() (/a/directory/path/on/my/machine/myotherprojectsrc/mylibs/lib1/MyClass.cpp:5)

Could be tweeked in the config file:

memcheck_report_path_prefix_replacement["/a/directory/path/on/my/machine/myotherprojectsrc"]="<my lib project src>"
memcheck_report_path_prefix_replacement["/a/directory/path/on/my/machine/myprojectsrc"]="<my bin project src>"

And the generation would look like this:

==1== Conditional jump or move depends on uninitialised value(s)
==1==    at 0x10101042: myFunc() (<my lib project src>/mylibs/lib1/MyClass.cpp:14)
==1==    by 0x10101042: main (<my bin project src>/main.cpp:34)
==1==  Uninitialised value was created by a stack allocation
==1==    at 0x10101042: myFunc() (<my lib project src>/mylibs/lib1/MyClass.cpp:5)
@Farigh Farigh added the enhancement New feature or request label Jan 21, 2021
@Farigh Farigh added this to the v1.2 milestone Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant