The problem is that inside GDB, keyword list
is reserved. Specifically:
list linenum
Print lines centered around line number linenum in the current source file.
So, the quickest solution to read the value of that variable is to rename it. For example, if you rename the variable list
-> alist
, then printing alist
will work. For the purposes of debugging the application this should suffice.