assertion error in pretty printing

Jonah Graham
Wed Jul 7 18:34:06 GMT 2021

Hi folks.

I have an internal error in GDB that AFAICT is down to the python pretty
printers. This is being hit by CDT (reported in

Doing a -var-update I get this internal error:

~"/scratch/gdb/binutils-gdb/gdb/c-varobj.c:516: internal-error: std::string
c_value_of_variable(const varobj*, varobj_display_formats): Assertion
`!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has
been detected,\nfurther debugging may prove unreliable.\nQuit this
debugging session? (y or n) "

Steps to reproduce:

Get source from
> bug574645.cpp
g++ -std=c++2a -O0 -g3 bug574645.cpp -o bug574645
gdb --interpreter=mi2

then use these commands:
8-gdb-set print object on
19-file-exec-and-symbols --thread-group i1 bug574645
26-break-insert -f bug574645.cpp:31
27-break-insert -t -f main
29-exec-run --thread-group i1
41-var-create --thread 1 --frame 0 - * data2
44-var-list-children var1 0 1
48-exec-continue --thread 1
51-var-update 1 var1

If running with a locally built GDB the python pretty printers need to be
pointed at (e.g. add  --data-directory=/usr/share/gdb to gdb command line)

Where do I start debugging this? I have reproduced with latest HEAD of
gdb + the data directory on my Ubuntu 20.04 machine.


Jonah Graham
Kichwa Coders

More information about the Gdb mailing list