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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks, I can confirm that error. Oddly, it works fine when printing the
variable within its own stack frame:

$ gdb -q -ex "br printf" -ex r -ex up -ex bt -ex down -ex bt -ex cont -ex q 
map
Reading symbols from map...
Breakpoint 1 at 0x401030
Starting program: /tmp/map 

Breakpoint 1, __printf (format=0x403007 "%d\n") at printf.c:28
28      {
#1  0x0000000000401272 in foo (map=std::unordered_map with 1 element = {...})
at map.cc:16
16        __builtin_printf("%d\n", *it);
#0  __printf (format=0x403007 "%d\n") at printf.c:28
#1  0x0000000000401272 in foo (map=std::unordered_map with 1 element = {...})
at map.cc:16
#2  0x0000000000401203 in main () at map.cc:9
#0  __printf (format=0x403007 "%d\n") at printf.c:28
28      {
#0  __printf (format=0x403007 "%d\n") at printf.c:28
#1  0x0000000000401272 in foo (Python Exception <class 'gdb.error'> No type
named std::__detail::_Hash_node<struct std::pair<int const, int>, false>.: 
map=std::unordered_map with 1 element) at map.cc:16
#2  0x0000000000401203 in main () at map.cc:9
Continuing.
42
[Inferior 1 (process 679052) exited normally]

It fails when it's not at the top of the stack.

Reply via email to