-1

gdb has some functionalities that I would like to use in a program. For example tracing a program's system calls and the "list" functionality that shows the source code of a program.

I know that gdb uses both ptrace and the BFD libraries to accomplish these 2 functionalities. However, instead of rewriting already existing code, I am interested in finding libraries and functions that I could use.

Does anyone know if there are gdb libraries that I could use? and if not, are there any other similar debuggers that I could use that might offer these functionalities?

cipher
  • 53
  • 6
  • Possible duplicate of [C/C++ Linux GDB API](http://stackoverflow.com/questions/32921105/c-c-linux-gdb-api) – ks1322 Oct 10 '16 at 11:44

2 Answers2

2

Does anyone know if there are gdb libraries that I could use?

There are not. There was a proposal to have GDB packaged as a re-usable libgdb, but the effort never received much support and has been completely abandoned 7 years ago.

are there any other similar debuggers that I could use that might offer these functionalities?

The lldb follows the general LLVM direction of packaging everything as a library:

The LLDB debugger APIs are exposed as a C++ object oriented interface
in a shared library.

I have no personal experience with it.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
0

You might want to explore on libdgb. Although I don't know if this being actively pursued.

zapstar
  • 489
  • 2
  • 9
  • 21