Compiling and injecting code in GDB: C++ in addition to C?

Tom Tromey tom@tromey.com
Fri Feb 10 17:01:42 GMT 2023


>>>>> "Robin" == Robin Whittle <rw@firstpr.com.au> writes:

Robin> Is it possible to inject C++ code, with any version of gdb and gcc/g++?

My experience is that the C++ plugin isn't very functional.  It seems to
have some bugs and crash pretty frequently as well.  Also, it seems like
nobody is actively working on it.

Robin> I want this capability so I can easily dump the contents of large,
Robin> complex, vectors of class objects to a text file, likely multiple
Robin> times the middle of a debug session.  Also I would like to be able to
Robin> modify such data programmatically.

I wonder if you could do some trick like have a library, then use
'compile' in C mode to dlopen it.  Not great of course.

Tom


More information about the Gdb mailing list