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/link: generate debugging information to display inlined functions in backtraces #4735

Closed
remyoudompheng opened this issue Jan 31, 2013 · 12 comments

Comments

@remyoudompheng
Copy link
Contributor

Inlined functions do not show up in backtraces. It would be interesting to add support
for inlined functions in backtraces so that inlining of non-leaf functions does not
break behaviour.
@minux
Copy link
Member

minux commented Feb 1, 2013

Comment 1:

yeah, this is an interesting task.
i suggest we switch to DWARF, so that we don't need an extra copy of
DWARF just for gdb.
are there any readily usable DWARF reader with BSD license?

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@ianlancetaylor
Copy link
Contributor

Comment 2:

For reading line number information, not types: gcc/libbacktrace.  It's in the GCC
source code but it's under a BSD license.

@minux
Copy link
Member

minux commented Feb 1, 2013

Comment 3:

can we afford to use it in our runtime library?
how big is it?

@ianlancetaylor
Copy link
Contributor

Comment 4:

It would take some adjustment for the gc runtime library, of course (I already use it in
the gccgo runtime library).  The DWARF reading code is 3000 lines and compiles to 18,685
bytes on amd64 when compiled with GCC when optimizing.  That includes some error
handling and some generality that may not be necessary.  The ELF reading code, which is
probably unnecessary, is 900 lines, 4269 bytes.

@rsc
Copy link
Contributor

rsc commented Feb 1, 2013

Comment 5:

There's a dwarf reader in plan9port too, integrated into its copy of
libmach.

@robpike
Copy link
Contributor

robpike commented Mar 7, 2013

Comment 6:

Labels changed: removed go1.1maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@dvyukov
Copy link
Member

dvyukov commented Jul 26, 2014

Comment 10:

FWIW we could use the new PC-associated data to store info about inlined functions. I
don't know what will be the amount of duplicated info, though.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/ld: generate debugging information to display inlined functions in backtraces cmd/link: generate debugging information to display inlined functions in backtraces Jun 8, 2015
@tdewolff
Copy link

Does this happen to be on anyone's radar for 1.8 or 1.9? Or is this a low-priority feature request?

More aggressive inlining would certainly give a large performance boost to a lot of constructs. For example, inlining thunk functions (#8421) and inlining functions that can't inline all the way down (@dr2chase comment in #11189). The last one would certainly help me in one spot: https://github.com/tdewolff/buffer/blob/master/lexer.go#L158, which is a function that is called very often but only sometimes calls the costly read function. Peek would increase performance for the parsers using this library by 10%-20%, which is a lot!

@thanm
Copy link
Contributor

thanm commented Jan 12, 2022

As far as I know, this is now fixed (see proposals 19348 and 22080). Closing, please re-open if needed.

@thanm thanm closed this as completed Jan 12, 2022
@golang golang locked and limited conversation to collaborators Jan 12, 2023
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

9 participants