On Wed, Jul 15, 2015 at 3:55 PM, Ryan Brown <
rib...@google.com> wrote:
>
> - There's no scope information for variables. It is very confusing seeing
> uninitialized values if you try to print a local variable before it comes
> into scope. Or even worse, when variables are shadowed there's no way to
> know which one to print.
> - The imports for a file are not represented in dwarf. This makes
> expression parsing difficult when you need to refer to a type.
Yes.
>
> There's also a few smaller annoyances:
> - I believe the addresses for variables are only guaranteed to be correct
> at function calls. Things mostly work if you disable optimizations, but it
> would be nice to have correct location expressions for each line.
This is conceptually complex and I find it less useful in practice
than it would appear. Alexandre Oliva went to considerable effort
adding this kind of thing to GCC. In my experience, the main effect
was that where in the past "print v" would show garbage, now it show
an error message "v has no value at this point." That is certainly
nicer, but I'm not sure it's worth the amount of work that is
required.
> - The dwarf could contain information on inlined functions so you don't
> have to compile with inlining disabled.
Yes.
> Part of the problem seems to be that the dwarf info is generated entirely in
> the linker, but the linker doesn't have information about scopes or register
> contents.
> I don't know the toolchain well enough but it seems like either the the
> compiler needs to pass this information to the linker, or the dwarf
> generation needs to be moved into the compiler.
Yes.
I don't know of anybody actively working on this.
Increased binary size due to extra debug info would be a conern, as
would increased compile time.
Ian