This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: creating debuginfo manually [slightly offtopic]
- From: Tom Tromey <tromey at redhat dot com>
- To: Akos PASZTORY <akos dot pasztory at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 04 Oct 2013 12:16:42 -0600
- Subject: Re: creating debuginfo manually [slightly offtopic]
- Authentication-results: sourceware.org; auth=none
- References: <CAJwHcF7qmFBwjZhJAmK9vKW2_BsMyWZFcbcH=pqsYmd30VR6zA at mail dot gmail dot com>
>>>>> "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