Skip to content

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Oct 6, 2025

Motivation

This breaks gdb pretty-printers inserted into .debug_gdb_scripts section, because it implies --compress-debug-sections=zlib, -Wa,--compress-debug-sections. This is very unfortunate, because then gdb can't use pretty printers for Boost.Unordered (which are very useful, since boost::unoredred_flat_map is impossible to debug). This seems perfectly fine to disable in the dev-shell for the time being.

See 1, 2, 3 for further references.

With this change I'm able to use boost's pretty-printers out-of-the box:

p *importResolutionCache
$2 = boost::concurrent_flat_map with 1 elements = {[{accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}] = {accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}}

When combined with a simple add-auto-load-safe-path ~/code in .gdbinit

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium xokdvium requested a review from Ericson2314 October 6, 2025 23:24
@xokdvium xokdvium requested a review from edolstra as a code owner October 6, 2025 23:24
@xokdvium
Copy link
Contributor Author

xokdvium commented Oct 6, 2025

cc @edolstra, @Ericson2314. Hope you appreciate the ability to once again debug unordered maps without jumping through hoops.

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

I remember noticing this kind of error message last week when I was poking at the localhost bug, so nice to see it fixed so soon!

This breaks gdb pretty-printers inserted into .debug_gdb_scripts section,
because it implies --compress-debug-sections=zlib, -Wa,--compress-debug-sections.
This is very unfortunate, because then gdb can't use pretty printers for
Boost.Unordered (which are very useful, since boost::unoredred_flat_map is
impossible to debug). This seems perfectly fine to disable in the dev-shell for
the time being.

See [1-3] for further references.

With this change I'm able to use boost's pretty-printers out-of-the box:

```
p *importResolutionCache
$2 = boost::concurrent_flat_map with 1 elements = {[{accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}] = {accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}}
```

When combined with a simple `add-auto-load-safe-path ~/code` in .gdbinit

[1]: https://gerrit.lix.systems/c/lix/+/3880
[2]: https://git.lix.systems/lix-project/lix/issues/1003
[3]: https://sourceware.org/pipermail/gdb-patches/2025-October/221398.html
@xokdvium xokdvium force-pushed the dev-shell-no-separate-debug-info branch from f433818 to c5b88c2 Compare October 7, 2025 21:57
@Mic92 Mic92 added this pull request to the merge queue Oct 8, 2025
Merged via the queue into master with commit 2ce3437 Oct 8, 2025
32 checks passed
@Mic92 Mic92 deleted the dev-shell-no-separate-debug-info branch October 8, 2025 04:36
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