Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] debug gdb/mi updates

	A short update on the debug front(...cdt.debug.*).
We have the basic framework in place, with the current code-base
one can now, step/next, see the stackframe and the variables in the
variable view.  It requires gdb-5.2.1(gdb/mi).

For GNU/Linux: the parse will break since the target outputs are not
               properly wrap in gdb/mi

For QNX: It's ok, the outputs are "proper" (gdb/mi).

Things will continue to move forward as we put in the new features
(breakpoints, disassembly etc ...) and stabilize the code.

The cdt debug team, will send other notices on every big milestones reached.
This is preliminary work.

GDB/MI 5.2.1
============

MI(5.2.1) is a big improvement over the earliers, say gdb-5.0.  The introduction
of mi List`[]' instead of using the mi Tuples `{}' makes things much more cleaner.

For the rewrite, we decided to tackle the problem differently, we departed
from the original approach by considering gdb/mi to be LL(1) and having a hand
written recursive decent parser.  The parser build an ASTs that are made
available as results to the commands to extract the relevant information.

The biggest advantage of MI is that it offers a formal syntax to extract
information, before each commands had to handle its own parsing.

Unfortunately, some inconsistencies and lots of work still.  We do
not remember them all but here are few annoyances:

- The syntax says:

	OUTPUT ==> (OUT-OF-BAND-RECORD)* [RESULT-RECORD] "(gdb)"nl

Which seems to imply that a gdb/mi output is zero or more out-of-bands
that can be followed by an optionnal resul-record and the termination
string "(gdb)\n".  But the output is more this:

	OUTPUT ==> (OUT-OF-BAND-RECORD)* | [RESULT-RECORD] "(gdb)"nl

Out-of-bands can come at any time and are not necessarly followed by "(gdb)\n"

- var-update syntax is:

	^done,changelist={name="var3",in_scope="true",type_changed="false",
	 name="var2",in_scope="true",type_changed="false"}

how about taking advantabe of the MI List:

	^done,changelist=[{name="var3",in_scope="true",type_changed="false"},
	 {name="var2",in_scope="true",type_changed="false"}]

which will regroup every object updates.

- Breaks,  there is no way to use gdb cli-command "condition" to change
  the condition of an mi -break-insert. Something like -break-condition
  would be nice.

- For temporary breaks, when the async oob comes it does not give the bpt number back.

- Some inconsitencies in the outputs; different when a mi result-record
  then when a mi oob, althought they carry the same information.

- no way to know what thread is selected when doing -thread-list-ids, you
  have to fall back to "info threads"

- some infos are only available to console-stream so you have to do some ad-hoc
  parsing on top of mi parsing.

- different kind of answer when using cli instead of mi.

etc..

Event with all of the annoyances 5.2.1 gdb/mi is a step in the right direction.

---
cdt debug team



Back to the top