This is an archive of the discontinued LLVM Phabricator instance.

Support DWARF discriminators in object streamer.
ClosedPublic

Authored by dnovillo on Feb 13 2014, 3:24 PM.

Details

Summary

This adds support for emitting DWARF path discriminator values in
the object streamer. It also changes the DWARF dumper to show
discriminator values in the line table output.

Diff Detail

Event Timeline

rafael added inline comments.Feb 13 2014, 4:24 PM
test/MC/ELF/discriminator.s
2 ↗(On Diff #7096)

I don't think -g is what you want in here. That will produce debug info for the assembly file.

dnovillo updated this revision to Unknown Object (????).Feb 14 2014, 6:48 AM

Remove -g from one of the calls to llvm-mc.

dnovillo updated this revision to Unknown Object (????).Feb 14 2014, 7:28 AM

I still haven't woken up. I need -g in *both* cases:

1- llvm-dwarfdump needs a -g .o or it will not generate its report.
2- If I do not use -g, I need to write a .file directive so .loc won't

get confused.

3- I cannot write a .file directive if I'm using -g.

So, the only way to get both tests here is to always run llvm-mc with
-g.

We really shouldn't be mixing debug information *in* the .s and debug
information generated *for* a .s.

It might be that dwarfdump has a bug and needs more information to
work. In which case that information should be in the .s or we should
fix dwarfdump.

Give me a sec. I am applying you patch and will debug it a bit to see
what is the issue.

It might be that dwarfdump has a bug and needs more information to
work. In which case that information should be in the .s or we should
fix dwarfdump.

It does look like an issue with how llvm-dwarfdump (and plain system
dwarfdump work). I removed the -g and added a .flie. With that
"readelf --debug-dump=rawline" can show the discriminator, but
dwarfdump and llvm-dwarfdump cannot. What dwarfdump tries to do is
dump on compilation unit at a time, and because of that it needs
.debug_info.

The proper fix is probably to implement something like "readelf
--debug-dump=rawline" or what we have right now in "llvm-readobj
-codeview-linetables".

For now, two options are

  • Just check the binary contents of the .debug_line section
  • extentd the .s to include a .debug_info (attached).

but lets please not mix debug info in the .s and debug info about the .s.

Cheers,
Rafael

  • {F37555, layout=link}
dnovillo updated this revision to Unknown Object (????).Feb 14 2014, 9:56 AM

Remove -g from llvm-mc call. Hand-code DWARF directives to work
around llvm-dwarfdump limitations (http://llvm.org/bugs/show_bug.cgi?id=18840).

dnovillo closed this revision.Feb 14 2014, 11:34 AM

Closed by commit rL201427 (authored by @dnovillo).

ychen added a subscriber: ychen.May 25 2015, 2:56 PM
ychen removed a subscriber: ychen.