This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using gdb symtab code



Hi,

I am writing a small utility to detect memleaks,
and I would like to print some informal backtraces
for the leaks. So I started writing code to read in ELF files,
demangling the symbols etc. Then I thought that GDB probably
allready implements all this stuff, and could be used for the task.

I could write a perl script or something to start
gdb, send commands to it and parse the output, but that is
IMHO the wrong way to do it.

The right solution would IMO be to separate the
needed code in GDB into a separate lib and
use that. Such a generic lib for symtab handling
and possibly also backtrace recording could also be
very usefull for other similar apps like GNU Checker
and for printing backtraces in crash handlers.

Anyways, I took a dive into the code & docs
and it seems a bit messy..
There does not seem to be a clean and abstract
separation between the UI side and the symtab side of the code.
Also there seems to be much usage of global variables.

So my question is: How would people look at it if I
used some GDB code as a starting-point for
a separate symbol-table handling lib with a
clean API ?

It would of course be under a compatible license.
I see there is an LGPL in the top directory of gdb.
Does this mean that I could put such a lib under LGPL if
I only used the symtab/objectfile parts of the GDB code ?

Nils Henrik




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]