This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB C API -- does such a thing exist?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: Ãmer Sinan AÄacan <omeragacan at gmail dot com>, gdb <gdb at sourceware dot org>
- Date: Thu, 16 Oct 2014 06:54:13 -0700
- Subject: Re: GDB C API -- does such a thing exist?
- Authentication-results: sourceware.org; auth=none
- References: <CAMQQO3=gR_6=D__Q_rn2Q8LQmE+bdokhAmbKh6fEkkNMH42fxA at mail dot gmail dot com> <543FBFCE dot 4030305 at redhat dot com>
> No. Well let me qualify. There is a libgdb, but I have never used it
> and I am not sure anyone has for some many years. I am not sure how
> maintained it is either. Someone else might know more.
I don't think there is a libgdb anymore. IIRC, Jan eliminated it,
because it was increasing the amount of time needed to be linked
(first generate the .a, next build using the .a).
> A direct C API, aka what we have with Python, while nice, is not
> likely any time soon. We cannot just expose all of the innards of GDB
> automatically, say with some script, to a C API. GDB internals were
> never designed to be exposed in such a way. The API would have to be
> a curated API and I don't see anyone working on that goal at present.
>
> If you are determined to go the C route, IMO your best bet would be to
> modify GDB directly to your needs and rebuild. GDB is fairly trivial
> to build. Less so to modify, but those are your options at the
> moment. ;)
Be aware that there is no stability guaranteed in our C API.
Maybe lldb might provide better guarantees in that respect.
I would personally look at either Python or GDB/MI first.
--
Joel