1

When looking at the backtrace in lldb, I'm sitting on frame #0, and attempt to move "down" the stack, but lldb says:

(lldb) down error: Already at the bottom of the stack

In my mind, I'm sitting at the top of the stack, since it's the top-most stack frame. Even the lldb commands to move up or down the stack seem backwards. Moving down, for example, will move from frame #1 to frame #0, with frame #0 being the frame I broke on. Any ideas why they are backwards? Or why I'm backwards? Or am I misses an essential concept of call stacks?

Canucklesandwich
  • 693
  • 6
  • 15

1 Answers1

4

I always try to use the terminology "older" and "younger" stack frames, since that reflects what is actually going on without relying on the detail of the direction stacks happen to grow in memory. But we used up and down in the command line mostly because that was what gdb did, and that's the command-line debugger most people were used to at the time we started lldb.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
  • Thanks for the insight. That helped me dig a little further into GDB docs. Outermost (older) frames have higher numbers, whereas younger frames have lower numbers—just like an age, really. `up` (which is really `up 1` moves up to a higher number (age). So `up`/`down` refers to the frame number, not the vertical direction of the stack. – Canucklesandwich Nov 25 '15 at 23:57