This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Gdb
Daniel Jacobowitz wrote:
On Wed, Oct 25, 2006 at 05:05:11PM +1000, Russell Shaw wrote:
There is far too much complexity for the simple things that gdb does.
I just don't know what to do with this message.
Yes, GDB is a bit crufty and could use some new design in places. But
calling the target control tasks "simple" is absurd. It is a typical
fallacy to assume that a task you are only lightly familiar with is
simple, when in fact most of the existing complexity is necessary.
There are places with long sequences of:
if() {
...
}
if() {
...
}
if() {
...
}
Instead of something more rigorous like:
if() {
...
}
else if {
...
}
else if {
...
}
...
else {
...
}
This makes touching anything unpredictable, as there's too many combinations
of possible code paths that may or may not be valid.
That's only one small example. The code is not well modularized. It's hard to
show that here. When a "run" resets a simple breakpoint, the stack depth is no
less than 35 levels. It also invokes a tortuous 10-level trip thru various
"memory set" functions until it eventually reaches target_xfer_partial or whatever,
intermingled with re-reading symbol files, re-syncing dynamic libraries, and
resetting breakpoints.
If there's no plans to redo gdb, i'll do it anyway.
You are welcome to submit individual patches which make areas of GDB
easier to understand. There are even some suggestions on the wiki.
It's undoable by anyone not intimately familiar with the code which means
weeks of prodding with a second gdb. The payoff is better in making something
totally different and new.