All Projects → kmcallister → Embedded Breakpoints

kmcallister / Embedded Breakpoints

Licence: other
Embed GDB breakpoints in C source code

Programming Languages

c
50402 projects - #5 most used programming language

A small hack for embedding GDB breakpoints in C source code.

Look at example.c, then run:

$ ./build.sh
$ ./gdb-with-breakpoints ./example
(gdb) run

gdb-with-breakpoints passes all its arguments to gdb. Additionally, the last argument must be a valid path to the program being debugged.

If the program contains no EMBED_BREAKPOINT statements, you will get an error like:

bfd_get_section_by_name: File in wrong format

Depends on: GNU toolchain, BFD, Linux /proc

On Debian or Ubuntu: apt-get install binutils-dev

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].