Bug 5815 - "up" and "down" are reversed
Summary: "up" and "down" are reversed
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
Depends on:
Blocks: 3459
  Show dependency treegraph
Reported: 2008-03-01 23:59 UTC by Tom Tromey
Modified: 2008-03-04 13:29 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2008-03-01 23:59:51 UTC
According to the hpd spec (downloaded from sourceware.org, see page 106)
"up" moves to a frame that has existed longer, and "down" "follows
the progress of program execution".

fhpd has these reversed.

In case it matters fhpd is also backwards from common use in *many*
other debuggers.  I looked at Emacs' "gud" mode and all the debuggers
it supports (dbx, gdb, xdb, jdb, perldb, and a few others) use "up"
and "down" in the same way.
Comment 1 Andrew Cagney 2008-03-03 14:09:19 UTC
Visually, the stack is displayed "top" (inner most) to "bottom" (outermost);
graphically we do the same.  For "up" to go down and "down" to go up would be
less consistent and more confusing for new new users.

*** This bug has been marked as a duplicate of 3459 ***
Comment 2 Mark Wielaard 2008-03-04 09:18:15 UTC
On irc Andrew suggested a compromise. Implement new command for new users called
either "inner" and "outer" or "older" and "newer". Which would avoid the whole
issue of whether a stack grows up or down.

Then we up/down can be just aliases to these commands which do what the HPD spec
says and how all other debuggers support these commands.

This would satisfactory resolve the complaint that fhpd is just being
gratuitously different.
Comment 3 Andrew Cagney 2008-03-04 13:29:21 UTC
Here is a stack:

    ---    <- top
  | --- |
  | --- |
  | --- |
  +-----+  <- bottom

when moving around that stack "up" goes towards the "top" and "down" goes
towards the bottom.

- Rosenburg's debugger book points this out
- a survey of old time debugger users point this out (they, without prompting,
complained that what GDB does is wrong)

Remember, our target is new users that will expect; and the decision to use this
model (and differ to the hpd) was made after long and careful discussion which
the entire group participated in.

There wasn't anything gratuitous about the decision.

If down/up were to be flipped, then so to would our back-trace order and our
display of a backtrace.  Not a must have first feature.