views:

124

answers:

2

If I'm trying to find a bug that's being called lower in the call stack, that'd be "down" the stack, right?

+1  A: 

For an upward growing stack (think plates), then yes. Something in a stack frame lower than your current frame is said to be 'below' you (though to be honest, I don't hear people say 'down' the stack often).

EDIT: And by 'lower', I mean in a stack frame which you've stored aside in order to get to your current frame. For instance:

int main() {
    a();
}

void a() {
    b();
}

int b() {
   return 0;
}

At the 'peak', main() would be the bottom frame, and on top of it would be a() and then b() at the top.

(Your comment about 'calling' a bug is also somewhat confusing.)

Andrew Song
+1 for qualifying "an upward growing stack". This seems to be the heart of the issue -- do you imagine the stack as growing upward or downward? I for one always think of stacks like the stacks of papers on my desk -- they always grow upward. (But AFAIK most OSs implement the call stack as growing downward instead, so that's a perfectly legitimate way of looking at it too...)
Daniel Pryden
+1  A: 

Correct. "Down" the stack means inside nested function calls. If A calls B and B calls C, C is "down the stack" from A, and A is "up the stack" from C.

Additionally, one doesn't usually "call" a bug. One "encounters" or "reproduces" bugs.

JSBangs