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

pkg/proc: enable basic debug functionality for stripped ELF binaries #3408

Merged
merged 6 commits into from
Jun 14, 2023

Conversation

derekparker
Copy link
Member

We used to parse the .gopclntab section but removed support in favor of
simply using DWARF debug information, due to lack of C symbols among
other reasons. This makes it impossible to debug stripped binaries,
which some distrubutions ship by default.

Add back in basic support for .gopclntab which survives if the binary
is stripped, allowing for rudimentary debugging such as basic
program navigation, tracing, etc...

We used to parse the .gopclntab section but removed support in favor of
simply using DWARF debug information, due to lack of C symbols among
other reasons. This makes it impossible to debug stripped binaries,
which some distrubutions ship by default.

Add back in basic support for .gopclntab which survives if the binary
is stripped, allowing for rudimentary debugging such as basic
program navigation, tracing, etc...
Copy link
Member

@aarzilli aarzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor things

pkg/proc/bininfo.go Show resolved Hide resolved
pkg/proc/bininfo.go Outdated Show resolved Hide resolved
pkg/proc/proc_test.go Outdated Show resolved Hide resolved
pkg/proc/threads.go Outdated Show resolved Hide resolved
pkg/proc/bininfo.go Outdated Show resolved Hide resolved
Copy link
Member

@aarzilli aarzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aarzilli aarzilli merged commit ccf17a6 into go-delve:master Jun 14, 2023
@kralicky
Copy link

@derekparker I'm (erroneously?) getting the "no debug info found" warning for these system libraries:

  • /usr/lib/libnss_mymachines.so.2, /usr/lib/libnss_resolve.so.2 (systemd-libs)
  • /usr/lib/libnss_mdns_minimal.so.2 (nss-mdns)
    The warning message doesn't specify which binary is missing debug symbols, so this was a bit confusing to run into.

@derekparker derekparker deleted the stripped-debugging branch November 7, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants