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

cmd/compile: omit args_stackmap and maybe others from DWARF #20462

Closed
josharian opened this issue May 23, 2017 · 4 comments
Closed

cmd/compile: omit args_stackmap and maybe others from DWARF #20462

josharian opened this issue May 23, 2017 · 4 comments
Milestone

Comments

@josharian
Copy link
Contributor

Run dwarfdump helloworld and poke through the results. I see entries like:

0x0003997e:     TAG_variable [3]  
                 AT_name( "runtime.asmcgocall.args_stackmap" )
                 AT_location( [0x00000000010cad08] )
                 AT_type( {0x00000000000278d0} ( <unspecified> ) )
                 AT_external( 0x01 )

and

0x0003c2f9:     TAG_variable [3]  
                 AT_name( "runtime.enoptrbss" )
                 AT_location( [0x0000000001146200] )
                 AT_type( {0x00000000000278d0} ( <unspecified> ) )
                 AT_external( 0x01 )

I don't see how these could ever arise in a debugging context; they're purely internals with no associated variables.

Depending on how many of these there are, it might be worth a bit of effort to avoid generating them.

@heschik @aarzilli @mdempsky

@josharian josharian added this to the Go1.10 milestone May 23, 2017
@aarzilli
Copy link
Contributor

We do read some internal stuff, specifically runtime.buildVersion, runtime.firstmoduledata, runtime.reflectOffs, runtime._type and associates and runtime.g. We also look up the entry point for a number of internal runtime functions (runtime.gopanic, runtime.deferreturn, runtime.breakpoint, runtime.stackBarrier that doesn't exist anymore and runtime.goexit).
We don't use those two, in general things that have unspecified type probably aren't very useful.

@heschi
Copy link
Contributor

heschi commented May 23, 2017

And just by coincidence, a heap viewer tool I've seen (that I'm not going to link here because I'm not sure the author wants it publicized) actually uses runtime.enoptrbss too. I think it's going to be very difficult to reliably predict whether a given field/type is useful or not.

It's sort of funny that a format as size-obsessed as DWARF has no way to reference a string from the symbol table. Not that I'd want to write that linker code.

...I wonder if you could declare a .debug_str section that overlapped .strtab...

@josharian
Copy link
Contributor Author

overlapped

Oy! :)

Sounds like there's no easy fruit here; closing.

@aarzilli
Copy link
Contributor

It's sort of funny that a format as size-obsessed as DWARF

mmmhhh have you seen the debug_ranges spec?

@golang golang locked and limited conversation to collaborators May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants