Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Handling of structure dereferencing
@ 2001-12-06  9:07 Daniel Jacobowitz
  2001-12-06 11:48 ` Eli Zaretskii
  2001-12-06 15:41 ` Tom Tromey
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2001-12-06  9:07 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Handling of structure dereferencing
@ 2001-12-06  9:46 Michael Elizabeth Chastain
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2001-12-06  9:46 UTC (permalink / raw)
  To: drow, gdb

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

As a user, this would be fine with me, although I can see how it would
bother other users.

It's 10x more important to me that "print foo.a" and "print foo.b()"
never return incorrect data.  I can live with virtual baseclass botch,
but when the debugger prints an incorrect value, that destroys my
faith in all the other values it prints.  If getting rid of the
implicit dereference helps, I'm all for it.

Michael C


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-02-05 18:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-06  9:07 Handling of structure dereferencing Daniel Jacobowitz
2001-12-06 11:48 ` Eli Zaretskii
2001-12-06 12:43   ` Daniel Jacobowitz
2002-01-02 20:25     ` Andrew Cagney
2002-02-05  9:31       ` Daniel Berlin
2002-02-05 10:17         ` Daniel Jacobowitz
2001-12-06 15:41 ` Tom Tromey
2001-12-06 23:36   ` Eli Zaretskii
2001-12-06  9:46 Michael Elizabeth Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox