This is the mail archive of the gdb@sources.redhat.com 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]

Handling of structure dereferencing


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


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