A high-level API for accessing DWARF debugging information, in C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
contrib
examples
include/dwarfpp
spec
src
tests
.gitignore
.gitmodules
.hgignore
LICENSE
LICENSE.lgpl-2.1
Makefile.am
README
TODO
autogen.sh
config.mk.in
configure.ac
libdwarfpp.pc.in

README

Build guide for the impatient:

$ git submodule init && git submodule update && \
    make -C contrib && \
    . contrib/env.sh # if you lack libsrk31c++ or libc++fileno
$ ./autogen.sh
$ ./configure
$ make
$ make -C tests    # if you're feeling conscientious; send bug reports!

A bit more detail:

To build this you'll need a recent-ish C++ compiler, a GNU build system,
recent-ish boost, and my other repositories libsrk31c++ and
libc++fileno (present as submodules in contrib/, if building from git).

You'll also need David Anderson's libdwarf (also submodule'd). I'm
slowly working on making things compile-time configurable to use libdw
instead (from elfutils), but it's not there yet.

Autotools support is new and is only lightly tested; improvements are
welcome. On some non-Debian-based distributions, libdwarf headers don't
appear in /usr/include but somewhere else. Configure with
--with-libdwarf-includes=/path/to/include to make this work. (You don't
need to worry about that if you're using the libdwarf submodule.)

There's not much documentation for the library. The easiest way to get
started is probably to look at the (smaller) examples in examples/.

What's included:

- an iterator-based DIE tree abstraction (root_die)
- friendly abstraction of DIE attributes, location lists etc.
- a DWARF expression evaluator (see caveats below)
- DIEs abstracted into class hierarchy (per-tag data types)
- ... providing many useful utility methods
- ... particularly for computing addresses
- can add and modify DIEs in memory (but not write out, yet; see below)
- frame information support (including eh_frame)

Completeness: various things are part-done, like the DWARF evaluator 
(only supports the opcodes I've needed so far) and support for multiple 
DWARF standards (mostly there, but not hooked up properly; in practice 
it doesn't matter too much). Many backwards iterators are also missing
(patches welcome). Register definitions are only for x86 arches at
present.

It can't generate DWARF output, yet, although this wouldn't be a
disruptive thing to add (still a non-trivial effort, though).

Send bug reports, patches etc. to Stephen Kell <srk31@cl.cam.ac.uk>.