Re: GDB Console




>>>>> "Dodji" == Dodji Seketeli <dodji-fIDRvF7C5exg9hUCZPvPmw public gmane org> writes:

Fabien> The goal is to have a console as similar as the real GDB as possible
Fabien> and with the least effort required to implement it, to do that I will
Fabien> just send the raw query to GDB/MI and print its output.

Dodji> Hmmh, I might disagree with this part.  I'd prefer the goal to be along
Dodji> the lines of "Being as close as reasonable to GDB, but no closer".  At
Dodji> least for a beginning.

Dodji> What I mean by this is, said bluntly, the console is meant to be a
Dodji> Nemiver console, not necessarily a GDB console.  If tomorrow there is a
Dodji> GDB v2 out there, or another debugging engine that comes as a library,
Dodji> or whatever, we should be able to just write a new implementation of the
Dodji> IDebugger interface for that new "backend" and the command console
Dodji> should just work with no change.  I don't know if that'll happen any
Dodji> time soon, but I think this is a right mental model to have to stick
Dodji> ourselves to having a well defined interface to GDB.

Dodji> Doing the right choice, sort of, rather than the easy one.

I think you should pick between two alternatives:

1. Implement a Nemiver CLI that is very different from the GDB CLI, or

2. Implement the console as a pass-through to whatever debugger is
underneath.

Trying to implement something that is similar to GDB seems like it will
end badly -- GDB will change, and Nemiver will continually be playing
catch-up.

My view is that #2 is probably preferable, but YMMV.  One attraction of
#1 is that the GDB CLI is not very well-designed.

Fabien> For few commands (ex: everything related to breakpoints), nemiver
Fabien> needs to get a feedback from GDB that it understand, this is why there
Fabien> will be some kind of filter that won't send the raw command to GDB and
Fabien> instead use the IDebugger interface (these commands might have some
Fabien> limitation compared to the real GDB command because of the often more
Fabien> limited GDB/MI interface).

Newer versions of GDB now emit MI async events when a breakpoint is
created via a CLI command.

We'll add new async events as needed to expose to the MI client other
state changes caused by the user.  File bugs if you know of missing
ones.

Tom



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]