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

nix gdb quirks and workarounds #564

Open
robwaz opened this issue Sep 15, 2024 · 1 comment
Open

nix gdb quirks and workarounds #564

robwaz opened this issue Sep 15, 2024 · 1 comment
Labels

Comments

@robwaz
Copy link
Member

robwaz commented Sep 15, 2024

gdb is particularly troubled with our nix setup. This issue will document the known issues as well as the current workarounds until a permanent fix is implemented.

There's decent odds I do not fully understand the underlying issues, so take the explanations with a grain of salt.

gdb lacks debug information
A default dojo install gdb will fail to break at libc symbols and will silently fail to run simple gdb scripts.

Fix: Add the following line to .gdbinit

set debug-file-directory /tmp/debug

gdb is not referencing the correct libc
Some libc symbols (example rev 19.0, memcpy), gdb will set a breakpoint, but it is at the incorrect address. As an immediate workaround a breakpoint can be set at the call site, or some other related location, but this functionality should behave as expected.

Fix: Specify the correct shared library path in .gdbinit

set solib-absolute-prefix /lib/x86_64-linux-gnu
@robwaz robwaz added the nix label Sep 15, 2024
@supercoolspy
Copy link
Contributor

supercoolspy commented Oct 8, 2024

https://github.com/edolstra/dwarffs may help with the first issue
It needs internet, we could possibly preload the debug symbols in the init script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants