This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB C API -- does such a thing exist?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]