https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127409

            Bug ID: 127409
           Summary: gcc's .gdbinit hooks don't load the libstdc++
                    pretty-printers
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rearnsha at gcc dot gnu.org
  Target Milestone: ---

gcc statically links against libstdc++, so the auto-loading facility for
loading the c++ library pretty-printers into gdb never get called.  The result
is that when debugging C++ elements like iterators they don't display properly
unless this stuff is all manually loaded.  In particular printing an iterator
generally only shows the C++ internals rather than the templated element.

(gdb) p mpi
$12 = {_M_node = 0xffffffffdea8}

(gdb) p *mpi   # Should print the templated iterator element type.
Attempt to take address of value not located in memory.

We construct a .gdbinit in the target build directory - this code should be
augmented with the relevant hooks to load the appropriate pretty-printers for
the version of libstdc++ that we have been linked against.

Reply via email to