Handling of structure dereferencing

Daniel Jacobowitz
2001-12-06T17:07:30Z

Right now, and historically, gdb has accepted things like:
struct foo {char a} *b, **c, ***d;

(gdb) print b.a
(gdb) print d->a

This is tied to a collection of very messy values handling, where we will
dereference pointers "as far as possible" in a lot of cases (like when
looking for members). It makes printing structs somewhat "easier", but in
my opinion, also rather more confusing.

So, straw poll: how would people feel about:
- not letting this happen; only explicit dereferencing

[random thought]
- and maybe, a print flag or something to allow us to print both the
value of a pointer and the dereferenced type by default. I spend a lot
of time doing "print longthing" up arrow "print longthing[0]" up arrow
"print longthing[0].otherfield" to walk down things like "struct type";
it would be nice if there were a way to do the first two steps at the same
time, since they are so very often associated.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer