mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-08 02:53:03 +08:00

added to assist. Apparently GCC subtracts enough stack space for all function params and uses relative ESP references. Perhaps GDB and friends assume that? But then how do they locate the start of the function? Studying this may be key to getting the dynamic core to generate the proper stack frame for C++ exceptions and GDB stack traces to work properly.
24 lines
320 B
C++
24 lines
320 B
C++
|
|
#include <stdio.h>
|
|
|
|
void __attribute__((noinline)) func1(int arg1) {
|
|
int stuff1 = 3,stuff4 = 4;
|
|
|
|
printf("%u/%u/%u\n",stuff1,stuff4,arg1);
|
|
}
|
|
|
|
int main() {
|
|
int alloc1 = 2,alloc2 = 4;
|
|
|
|
printf("%u/%u\n",alloc1,alloc2);
|
|
|
|
{
|
|
int alloc3 = 22,alloc4 = 44;
|
|
printf("%u/%u\n",alloc3,alloc4);
|
|
}
|
|
|
|
func1(99);
|
|
return 0;
|
|
}
|
|
|