Bug 117372 - std::list pretty printer: AttributeError: 'NoneType' object has no attribute 'pointer'
Summary: std::list pretty printer: AttributeError: 'NoneType' object has no attribute ...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-30 16:10 UTC by Simon Marchi
Modified: 2024-10-31 14:02 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Marchi 2024-10-30 16:10:57 UTC
I got this while debugging gdb with gdb.  I have not been able to make a small reproducer yet.

Steps:

1. Checkout binutils-gdb at commit 35d53ce6429a
2. configure with: ./configure 'CFLAGS=-g3 -O0' 'CXXFLAGS=-g3 -O0'
3. make
4. start gdb: ./gdb
5. attach using system gdb, or some other gdb configured to find the libstdc++ pretty printers
6. print current_program_space.objfiles_list

What I get is

(top-gdb) p current_program_space.objfiles_list
$1 = empty std::__cxx11::listTraceback (most recent call last):
  File "/usr/share/gcc-14.2.1/python/libstdcxx/v6/printers.py", line 422, in children
    nodetype = lookup_node_type('_List_node', self._val.type).pointer()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'pointer'


It's the result of `lookup_node_type` that is None.

The system gcc version is "gcc (GCC) 14.2.1 20240910" (Arch Linux package)

The system gdb version used to attach is 15.2 (Arch Linux package)