GDB C ++ - Checking STL containers when looking for a core dump?

I am debugging the main dump of my program (post-mortem) inside gdb. I opened it with: gdb [program_name] [server_name]

However, when I try to check the STL vector, for example. print vec-> size () or print vec-> at (0)

I get an error

"You cannot do this without a process for debugging"

I'm just trying to check the contents and sizes of these containers. Is there a way to attach a bogus process to gdb check with a core dump so that I can do this?

+3
source share
1 answer

print vector:

(gdb) print *vec

. "_M_buffer" - . , , , .

+2

All Articles