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/commands: fix to read debug info file from correct directory in trace command #3405

Merged
merged 1 commit into from
Jun 6, 2023
Merged

cmd/commands: fix to read debug info file from correct directory in trace command #3405

merged 1 commit into from
Jun 6, 2023

Conversation

nozzy123nozzy
Copy link
Contributor

I use dlv 1.20.2 (the latest). I experienced the problem that dlv trace -e always fails to read separated debug info like the below,

$ ~/go/bin/dlv trace --log -e /usr/bin/hugo 'commands\.new.*'
2023-06-05T01:50:12+09:00 info layer=debugger launching process with args: [/usr/bin/hugo]                                                                          
2023-06-05T01:50:12+09:00 warning layer=debugger gnu_debuglink link "7c03fe5487be2cbd7f7097fae18a1337dc56bf.debug" not found in any debug info directory            
could not launch process: could not open debug info - debuggee must not be built with 'go run' or -ldflags='-s -w', which strip debug info

The root cause is that the traceCmd function in cmd/dlv/cmds/commands.go doesn't reference conf.DebugInfoDirectories, therefore, openSeparateDebugInfo function in pkg/proc/bininfo.go tries to find the debug info in the wrong directory.

I suggest this PR to fix this problem.

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

Copy link
Member

@derekparker derekparker left a comment

Choose a reason for hiding this comment

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

LGTM

@derekparker derekparker merged commit 8b9c3a9 into go-delve:master Jun 6, 2023
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