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

Incorrect .debug_loc generated when using Location::BaseAddress with DWARF2 #448

Open
bjorn3 opened this issue Nov 12, 2019 · 3 comments
Open

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Nov 12, 2019

A base location entry is only existing since DWARF3. For DWARF2 it has to be expanded.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Nov 12, 2019

Same problem for .debug_ranges.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Nov 12, 2019

It turns out that my lldb and llvm-darfdump-7 doesn't understand BaseAddress at all for any version in 2..=4

$ lldb -v
lldb version 7.0.1

@philipc
Copy link
Collaborator

philipc commented Nov 13, 2019

For DWARF2 it has to be expanded.

I'm not sure this is something gimli should do itself. It would require a relocation for every entry, right? We could return an error for this case, but I haven't decided yet whether enforcing this kind of strictness is good. I think other compilers have options for how strict they are (-gstrict-dwarf for gcc).

Same problem for .debug_ranges.

.debug_ranges doesn't exist in DWARF2. I guess we could return an error here too. However, if the ranges are discontiguous then I'm not sure you have any other way to do this.

It turns out that my lldb and llvm-darfdump-7 doesn't understand BaseAddress at all for any version in 2..=4

Is this only for .debug_loc? I would be surprised if it can't handle this for .debug_ranges.

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

2 participants