This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Aw: Using C++ code inside gdb
- From: "Klaus Rudolph" <lts-rudolph at gmx dot de>
- To: Ashutosh <ashutoshpal2006 at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 8 Oct 2015 15:05:29 +0200
- Subject: Aw: Using C++ code inside gdb
- Authentication-results: sourceware.org; auth=none
- References: <CADHm+ztUrxkStMRgqTFTnz+d02jHT5wTCmJH3qwUQximA5x+Kg at mail dot gmail dot com>
- Sensitivity: Normal
>
> I plan to add a standalone module inside gdb code that contains
> information about the memories in the target, but want to organize it
> in the form of a C++ class. My question is: Has anybody earlier tried
> adding C++ code to gdb code-base and how easy it would be to do so?
> Any guidelines?
>
You can call every function/method with "print funcName" from gdb command line. So if you add your debug code to your executable you should be able
to run every function from your debug extension. You must take care that your debug code is not optimized out because
you have no calls from your application to the debug code itself. So you do not need any changes to the debugger or gdbserver
itself.
But maybe I have a misunderstanding from your question...
Regards
Klaus