ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
callstacktest.c
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
11 #include <stdio.h>
12 #include <tamtypes.h>
13 #include <debug.h>
14 
18 {
19  unsigned int* stackTrace[256];
20  int i = 0;
21 
22  ps2GetStackTrace((unsigned int*)&stackTrace,256);
23 
24  for(i = 0; i < 256; ++i)
25  {
26  if (stackTrace[i] == 0)
27  break;
28 
29  printf("adress %d 0x%08x\n",i,(int)stackTrace[i]);
30  }
31 
32  return 0;
33 }
34 
36 {
37  return TestFunction3();
38 }
39 
41 {
42  return TestFunction2();
43 }
44 
45 int main()
46 {
47  testFunction1();
48 
49  while(1)
50  {
51  }
52 
53  return 0;
54 }
int TestFunction2()
Definition: callstacktest.c:35
int TestFunction3()
Definition: callstacktest.c:17
int testFunction1()
Definition: callstacktest.c:40
int main()
Definition: callstacktest.c:45
void ps2GetStackTrace(unsigned int *results, int max)
Definition: callstack.c:119