GDB C++ - Inspecting STL Containers when looking at a core dump?

后端 未结 1 814
情深已故
情深已故 2021-01-19 21:37

I\'m debugging a core dump of my program (post-mortem) inside gdb. I opened it with: gdb [program_name] [core_name]

However when I attempt to inspect a STL vecto

1条回答
  •  迷失自我
    2021-01-19 22:36

    print the vector:

    (gdb) print *vec
    

    Then familiarize yourself with the internals of your implementation's vector and print the raw buffer. Often called "_M_buffer" or something like that. Depending on how yours is done there may be an internal object that the buffer is inside of.

    0 讨论(0)
提交回复
热议问题