Mercurial > hg > CbC > old > device
diff test/stackframe.c @ 880:5313ed059cee
no tabs in source
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 03 Apr 2014 10:43:01 +0900 |
parents | c2c709727221 |
children |
line wrap: on
line diff
--- a/test/stackframe.c Thu Apr 03 10:34:02 2014 +0900 +++ b/test/stackframe.c Thu Apr 03 10:43:01 2014 +0900 @@ -89,10 +89,10 @@ int l1 = L1; frame_pointer("frame"); if (a1==1) { - top = (int *)__builtin_alloca(16); - printf("#0092:alloca %08x\n",top); + top = (int *)__builtin_alloca(16); + printf("#0092:alloca %08x\n",top); } else { - top = &l0; + top = &l0; } printf("#0096:local %08x\n",&l0); @@ -101,27 +101,27 @@ #define OFFSET 16 i = -OFFSET; for(p = top-OFFSET;p<top+0x100; ) { - if (*p==(int)ret) { - printf("#0104:%08x: %08x ret address\n",p,i); - } else if (*p==A0) { - printf("#0106:%08x: %08x caller arg 1\n",p,i); - } else if (*p==A2) { - printf("#0108:%08x: %08x caller arg last\n",p,i); - } else if (*p==A3) { - printf("#0110:%08x: %08x callee arg 1\n",p,i); - } else if (*p==A4) { - printf("#0112:%08x: %08x callee arg last\n",p,i); - } else if (*p==L0) { - printf("#0114:%08x: %08x local var top\n",p,i); - } else if (*p==L1) { - printf("#0116:%08x: %08x local var end\n",p,i); - } else if (*p==L2) { - printf("#0118:%08x: %08x stack top (alloca)\n",p,i); - } else { - // printf("#0120: %08x",*p); - } - i+= sizeof(int); - p++; + if (*p==(int)ret) { + printf("#0104:%08x: %08x ret address\n",p,i); + } else if (*p==A0) { + printf("#0106:%08x: %08x caller arg 1\n",p,i); + } else if (*p==A2) { + printf("#0108:%08x: %08x caller arg last\n",p,i); + } else if (*p==A3) { + printf("#0110:%08x: %08x callee arg 1\n",p,i); + } else if (*p==A4) { + printf("#0112:%08x: %08x callee arg last\n",p,i); + } else if (*p==L0) { + printf("#0114:%08x: %08x local var top\n",p,i); + } else if (*p==L1) { + printf("#0116:%08x: %08x local var end\n",p,i); + } else if (*p==L2) { + printf("#0118:%08x: %08x stack top (alloca)\n",p,i); + } else { + // printf("#0120: %08x",*p); + } + i+= sizeof(int); + p++; } }