• Stars
    star
    311
  • Rank 133,773 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C++11 ELF/DWARF parser

Libelfin is a from-scratch C++11 library for reading ELF binaries and DWARFv4 debug information.

Quick start

make, and optionally make install. You'll need GCC 4.7 or later.

Features

  • Native C++11 code and interface, designed from scratch to interact well with C++11 features, from range-based for loops to move semantics to enum classes.

  • Libelfin fully implements parsing for Debugging Information Entries (DIEs), the core data structure used by the DWARF format, as well as most DWARFv4 tables.

  • Supports all DWARFv4 DIE value types except location lists and macros.

  • Nearly complete evaluator for DWARFv4 expressions and location descriptions.

  • Complete interpreter for DWARFv4 line tables.

  • Iterators for easily and naturally traversing compilation units, type units, DIE trees, and DIE attribute lists.

  • Every enum value can be pretty-printed.

  • Large collection of type-safe DIE attribute fetchers.

Non-features

Libelfin implements a syntactic layer for DWARF and ELF, but not a semantic layer. Interpreting the information stored in DWARF DIE trees still requires a great deal of understanding of DWARF, but libelfin will make sense of the bytes for you.

Using libelfin

To build against libdwarf++, use, for example

g++ -std=c++11 a.cc $(pkg-config --cflags --libs libdwarf++)

To use a local build of libelfin, set PKG_CONFIG_PATH. For example,

export PKG_CONFIG_PATH=$PWD/elf:$PWD/dwarf

There are various example programs in examples/.

Status

Libelfin is a good start. It's not production-ready and there are many parts of the DWARF specification it does not yet implement, but it's complete enough to be useful for many things and is a good deal more pleasant to use than every other debug info library I've tried.

More Repositories

1

latexrun

A 21st century LaTeX wrapper
Python
615
star
2

go-misc

Miscellaneous Go hacks
Go
224
star
3

sv6

POSIX-like scalable multicore research OS kernel
C
181
star
4

perflock

Locking wrapper for running benchmarks on shared hosts
Go
147
star
5

go-perf

Go packages and tools for Linux perf
Go
142
star
6

biblib

Simple, faithful BibTeX parser and algorithms for Python 3
Python
113
star
7

mtrace

Memory access tracing QEMU
C
93
star
8

commuter

Automated multicore scalability testing tool
Python
87
star
9

go-moremath

An assortment of more specialized math routines for Go
Go
65
star
10

cpubars

Lightweight terminal-based multicore CPU usage monitor
C
58
star
11

go-gg

Plotting package for Go
Go
41
star
12

go-gcstats

Go runtime GC trace analysis and statistics tool
Go
35
star
13

go-obj

Object file abstractions in Go
Go
30
star
14

go-z3

Bindings for the Z3 SMT solver
Go
28
star
15

objbrowse

Interactive object file browser with symbol, source, assembly, and analysis
TypeScript
22
star
16

go-perf-v2

Work space for golang.org/x/perf version 2
Go
20
star
17

go-rabin

Rabin hashing and content-defined chunking for Go
Go
19
star
18

benchplot

Tool for plotting Go benchmark results
Go
14
star
19

go-perfevent

A Go API for perf_event_open
Go
14
star
20

notmuch

UNIX mail with full text search, tags, and global threading
C
11
star
21

go-gcpacing

Go concurrent GC pacing simulator
Python
11
star
22

memtrace

Pintool for logging memory writes
Go
11
star
23

quickfilter

Simple, lean, client-side JavaScript faceted search UI
JavaScript
7
star
24

my-bin

My random binaries
Python
6
star
25

go-gcbench

Benchmarks for the Go garbage collector
Go
5
star
26

my-dotfiles

My dotfiles
HTML
5
star
27

thesis

PhD dissertation on the scalable commutativity rule
C
5
star
28

shade

Program for modeling solar flux through the year
Go
3
star
29

my-hass

Custom Home Assistant components
Python
2
star
30

gotest

"go test" runner with nice output
Go
2
star
31

.emacs.d

My Emacs configuration
Emacs Lisp
1
star
32

jsjs

Toy JavaScript-to-JavaScript compiler
JavaScript
1
star
33

go-gc-efficiency

Go GC efficiency experiments support code
Go
1
star
34

ac

Basic architectural calculator
Go
1
star