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

backtrace_pcinfo yields mixed relative and absolute pathes #26

Closed
athre0z opened this issue May 12, 2019 · 2 comments
Closed

backtrace_pcinfo yields mixed relative and absolute pathes #26

athre0z opened this issue May 12, 2019 · 2 comments

Comments

@athre0z
Copy link

athre0z commented May 12, 2019

https://github.com/ianlancetaylor/libbacktrace/blob/master/dwarf.c#L2874

Absolute paths are returned when no line info is found, relative ones for all other cases. The code that creates an abs path from the relative one is only invoked when ln == NULL. What is the intuition behind that? I think it would be better to always return absolute paths, or always return relative ones and make comp_dir available to the user.

Related: athre0z/color-backtrace#2

@ianlancetaylor
Copy link
Owner

The code does the same thing in all cases, as far as I can see. In the ln == NULL case in dwarf_lookup_pc, there is no entry in the line table, so we add the directory to a relative path name there. When there is an entry in the line table, we add the directory when we build the line table information in read_line_program. So while there could certainly be a bug here, I think I need to see a test case. Thanks.

@timotheecour
Copy link

So while there could certainly be a bug here, I think I need to see a test case. Thanks.

@ianlancetaylor => #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants