Skip to content

scottt/embedded-breakpoints

 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • C 64.1%
  • Python 33.0%
  • Shell 2.9%