Backtracing

Last question for a bit, I promise :P

Can I cause the stack to regurgitate it's contents into variables that I can print?

I just want to print everything on the stack... I've tried looking at the generated assembler but it doesn't seem to use a stack :l

Also; I feel like gcc is doing more work than me:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ wc -l *.c
  22 checkevents.c
  15 cleanup.c
  59 image.c
 105 init.c
 110 main.c
   7 updatescreen.c
 318 total
chris@chris ~/Projects/C++/sdl $ wc -l *.s
  108 checkevents.s
  120 cleanup.s
  257 image.s
  331 init.s
  292 main.s
   76 updatescreen.s
 1184 total
Of course the Assembly uses a stack. Depending on a function's calling convention, there should be a bunch of pushes before a function call and a bunch of pops after.
http://en.wikipedia.org/wiki/X86_assembly_language#Stack_instructions
There is; what I mean is I can't find an explicit reference to it; so I can't call printf on it's contents :(
Topic archived. No new replies allowed.