This is the mail archive of the gdb@sourceware.org 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]

Re: creating debuginfo manually [slightly offtopic]


>>>>> "Akos" == Akos PASZTORY <akos.pasztory@gmail.com> writes:

Akos> I was debugging some reverse engineering challenges and wondered: is
Akos> it possible to define debuginfo semi-manually?

Sure.

Akos> Let's say I have a stripped binary but I already learned that there is
Akos> an array of structs at location 0x0804abcd.
Akos> I would like to teach that also to gdb, probably via symbol-file.  (Or?)

Alternatively you can use the JIT API to get data into gdb.

Akos> I was thinking how to create this debuginfo file.  I came up with
Akos> this ugly way:

Yeah, that's an ok approach.

Akos> Is there any better way to do this?

In the test suite we have a "DWARF assembler" written in Tcl.  It lets
you emit a subset of DWARF (just whatever we've needed for tests) to
your specification.

One could reuse this or write a new similar one -- it isn't hard.  The
whole thing is less than 1000 LOC.

It might be nice if symbols and types could be created dynamically using
Python.  However, I'm not aware of anybody working on this, and it
certainly has some non-obvious components.

Tom


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