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: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Stan Shebs <stanshebs at earthlink dot net>
- Cc: gdb at sourceware dot org
- Date: Fri, 17 Oct 2014 14:02:50 +0200
- 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> <5440588D dot 8060503 at earthlink dot net>
On Fri, 17 Oct 2014 01:45:17 +0200, Stan Shebs wrote:
> The fact of the situation is that a C API would make things harder, not
> easier. Consider that GDB is a) making system calls, which are
> sometimes blocking, b) is doing tricks with signals all over the place,
Yes but those are cornercases.
> and c) gets involved with permissions,
I do not see what you mean there.
> and d) manages vast quantities of memory.
What's the problem with multi-process vs. single-process solution?
The problem is that GDB corrupts memory as it is not written in C++.
I was trying to switch GDB to C++ which was rejected and then I at least
posted some -fsanitize=address patches which were ignored.
> MI is really the safe way to go.
The problem with MI is that there is (AFAIK) still no good enough client
library and primarily MI implements only very poor subset of GDB functionality
so one has to use '-interpreter-exec console ...' anyway and parse the
unparsable text output.
Thanks but C API is much easier (C++ would be sure even easier). LLDB has C++
API but that can never work well for GDB due to GPL of GDB.
Jan