Mercurial > hg > CbC > old > device
diff test/stackframe.c @ 748:c2c709727221
i64 continue... basic.s assembled.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 13 Nov 2010 22:39:40 +0900 |
parents | 5e71527f9fd6 |
children | 5313ed059cee |
line wrap: on
line diff
--- a/test/stackframe.c Sat Nov 13 10:47:47 2010 +0900 +++ b/test/stackframe.c Sat Nov 13 22:39:40 2010 +0900 @@ -27,13 +27,13 @@ void *fr,*st; __asm__("\tmovl %%ebp,%0\n": "=r" (fr)); __asm__("\tmovl %%esp,%0\n": "=r" (st)); - printf("fr=%08x st=%08x at %s\n",fr,st,s); + printf("#0029:fr=%08x st=%08x at %s\n",fr,st,s); #else #ifdef ppc void *fr,*st; __asm__("\tmr %0,31\n": "=r" (fr)); __asm__("\tmr %0,1\n": "=r" (st)); - printf("fr=%08x st=%08x at %s\n",fr,st,s); + printf("#0035:fr=%08x st=%08x at %s\n",fr,st,s); #endif #endif } @@ -49,10 +49,10 @@ frame_pointer("int frame"); i0 = f0 = 0.3; - printf("int 0 offset: %08x\n",&a0-&i0); - printf("int 1 offset: %08x\n",&a0-&i1); - printf("int 1 offset: %08x\n",&a0-(int*)float_frame(A1)); - printf("%d\n",f0); + printf("#0051:int 0 offset: %08x\n",&a0-&i0); + printf("#0052:int 1 offset: %08x\n",&a0-&i1); + printf("#0053:int 1 offset: %08x\n",&a0-(int*)float_frame(A1)); + printf("#0054:%d\n",f0); return i0; } @@ -66,9 +66,9 @@ frame_pointer("float frame"); f0 = 0.3; - printf("local0 offset: %08x\n",&a0-&i0); - printf("local1 offset: %08x\n",&a0-&i1); - printf("%g\n",f0); + printf("#0068:local0 offset: %08x\n",&a0-&i0); + printf("#0069:local1 offset: %08x\n",&a0-&i1); + printf("#0070:%g\n",f0); return &i0; } @@ -90,11 +90,11 @@ frame_pointer("frame"); if (a1==1) { top = (int *)__builtin_alloca(16); - printf("alloca %08x\n",top); + printf("#0092:alloca %08x\n",top); } else { top = &l0; } - printf("local %08x\n",&l0); + printf("#0096:local %08x\n",&l0); *top = L2; called(A3,A1,A4); @@ -102,23 +102,23 @@ i = -OFFSET; for(p = top-OFFSET;p<top+0x100; ) { if (*p==(int)ret) { - printf("%08x: %08x ret address\n",p,i); + printf("#0104:%08x: %08x ret address\n",p,i); } else if (*p==A0) { - printf("%08x: %08x caller arg 1\n",p,i); + printf("#0106:%08x: %08x caller arg 1\n",p,i); } else if (*p==A2) { - printf("%08x: %08x caller arg last\n",p,i); + printf("#0108:%08x: %08x caller arg last\n",p,i); } else if (*p==A3) { - printf("%08x: %08x callee arg 1\n",p,i); + printf("#0110:%08x: %08x callee arg 1\n",p,i); } else if (*p==A4) { - printf("%08x: %08x callee arg last\n",p,i); + printf("#0112:%08x: %08x callee arg last\n",p,i); } else if (*p==L0) { - printf("%08x: %08x local var top\n",p,i); + printf("#0114:%08x: %08x local var top\n",p,i); } else if (*p==L1) { - printf("%08x: %08x local var end\n",p,i); + printf("#0116:%08x: %08x local var end\n",p,i); } else if (*p==L2) { - printf("%08x: %08x stack top (alloca)\n",p,i); + printf("#0118:%08x: %08x stack top (alloca)\n",p,i); } else { - // printf(" %08x",*p); + // printf("#0120: %08x",*p); } i+= sizeof(int); p++; @@ -133,7 +133,7 @@ ret = &&label; frame(A0,A1,A2); frame(A0,1,A2); - printf("\n"); + printf("#0135:\n"); float_frame(A0); int_frame(A0); label: