Questions Regarding Go 1.15 Dwarf generation

116 views
Skip to first unread message

m.hos...@gmail.com

unread,
Feb 22, 2021, 3:59:01 PM2/22/21
to golang-nuts
Hi,
I am experimenting with dwarf generation in Go1.15 at the moment and looking into new loader module. I am trying to understand how the data being generated and put into []byte specifically how the loader.payloads item being generated. I couldn't figure it out yet.
There is a LoadFull function in loader with works with payloads but I have no idea what function and in what phase the raw data for each symbols being created and added to payloads. I would appreciate if anyone could help me in this regard. 

Best,

Ian Lance Taylor

unread,
Feb 22, 2021, 11:36:30 PM2/22/21
to m.hos...@gmail.com, golang-nuts
This code is different in 1.16. I recommend that you look at 1.16.

Some DWARF information is generated at compile time and some is
generated at link time. Is there anything specific you are interested
in?

Ian

Mahdi Hosseini

unread,
Feb 23, 2021, 12:29:18 PM2/23/21
to Ian Lance Taylor, golang-nuts
Thanks for your reply.
Actually yes, I am looking at the dwarfGenerateDebugSyms function in dwarf.go in cmd/lin/internal/ld trying to understand how and when CUs are being generated and then added to dwarfp2 specially the header and length of each CU. 

R,
Mahdi

Than McIntosh

unread,
Feb 23, 2021, 12:59:32 PM2/23/21
to Mahdi Hosseini, Ian Lance Taylor, golang-nuts

I would second Ian's recommendation to look at the 1.16 code -- a lot has changed since 1.15. 

>>There is a LoadFull function in loader with works with payloads but I have no idea what function and in what phase the raw data for each symbols being created and added to payloads. I would appreciate if anyone could help me in this regard

LoadFull no longer exists in 1.16 -- it was a transitional function used due to the fact that as of the 1.15 release the linker wasn't completely converted to a new internal representation.

HTH

Than




--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAP%3DptTKW0BVjd1gonVREMxSwGnHiSX%2ByungkbatmcfkmK1q0Dg%40mail.gmail.com.

Mahdi Hosseini

unread,
Feb 23, 2021, 5:43:31 PM2/23/21
to Than McIntosh, Ian Lance Taylor, golang-nuts
Thank you, I would certainly do that. 
Reply all
Reply to author
Forward
0 new messages