Just curious, but someone can explain this conclusion to me info frame. Here's the toy program:
#include <stdio.h>
int foo(int argc) {
printf("Hello world! %d\n", argc);
}
int main(int argc, char *argv[]) {
foo(argc);
return 0;
}
and here is the output of gdb info framewhen split into foo:
(gdb) info frame
Stack level 0, frame at 0x28abf0:
eip = 0x401196 in foo (a.c:4); saved eip 0x4011c4
called by frame at 0x28ac10
source language c.
Arglist at 0x28abe8, args: argc=1
Locals at 0x28abe8, Previous frame sp is 0x28abf0
Saved registers:
ebp at 0x28abe8, eip at 0x28abec
(gdb) p &argc
$1 = (int *) 0x28abf0
(gdb)
Why are locales and arglist in one place? As I understand it, it
Locals atshould mean the current ebp value as the address of the upper bound for the locales of the current frame (what it does). But why does arglist point to the same place? A print-based &argcvalue for
Arglist atdefinitely does not indicate arguments.
, x86
. ,
, , Arglist at Locals at
:
http://forums.devshed.com/programming-42/gdb-info-frames-arglist-locals-address-782598.html
, ,
/ gdb. !