arm + linux 难解问题 求助高人
硬件环境 arm s3c2410a-20
交叉编译环境
CT_BINUTILS_VERSION=2.19.1
CT_KERNEL_VERSION=2.6.29.4
CT_LIBC_VERSION=2.9
[DEBUG] CT_ARCH_TARGET_CFLAGS=' -mlittle-endian -march=armv4t -mcpu=arm9tdmi -mtune=arm920t -msoft-float'
[DEBUG] CT_ARCH_TARGET_LDFLAGS=' -EL'
[DEBUG] CT_ARCH_TUNE=arm920t
gcc-4.3.2
出问题的代码如下
int main(int argc, char *argv[]){ U8 testBuf[100]= {0}; //memset( testBuf,0,100 ); U16 *len = (U16*)testBuf; U8 *ver = testBuf+2; U8 *msgType = testBuf+3; U8 *flag = testBuf+4; U32 *data = (U32*)(testBuf+5); *len = 4; *ver = 1; *msgType = 2; *flag = 3; int dataLen(0); bool reVal = true; //for (int i = 0; i < 100; ++i) //{ *data = 0xFFFFFFFF; //} return 0;}Breakpoint 1, main (argc=1, argv=0xbec05db4) at test.cpp:55 U8 testBuf[100]= {0};1: /x *testBuf @ 30 = {0xd8, 0xd0, 0x2, 0x40, 0xb0, 0xda, 0xf9, 0xe, 0xd8, 0xee, 0x2, 0x40, 0xe8, 0xdd, 0x1, 0x40, 0x50, 0xe5, 0x1, 0x40, 0x6c, 0xbd, 0x1c, 0x40, 0xc0, 0xd7, 0x1, 0x40, 0x0, 0x50}7 U16 *len = (U16*)testBuf;1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}8 U8 *ver = testBuf+2;1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}9 U8 *msgType = testBuf+3;1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}10 U8 *flag = testBuf+4;1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}11 U32 *data = (U32*)(testBuf+5);1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}13 *len = 4;1: /x *testBuf @ 30 = {0x0 <repeats 30 times>}14 *ver = 1;1: /x *testBuf @ 30 = {0x4, 0x0 <repeats 29 times>}15 *msgType = 2;1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x0 <repeats 27 times>}16 *flag = 3;1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2, 0x0 <repeats 26 times>}18 int dataLen(0);1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2, 0x3, 0x0 <repeats 25 times>}19 bool reVal = true;1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2, 0x3, 0x0 <repeats 25 times>}22 *data = 0xFFFFFFFF;1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2, 0x3, 0x0 <repeats 25 times>}25 return 0;1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2,[color=#FF0000] 0xff, 0xff, 0xff, 0xff, [/color] 0x0 <repeats 22 times>}26 }1: /x *testBuf @ 30 = {0x4, 0x0, 0x1, 0x2, 0xff, 0xff, 0xff, 0xff, 0x0 <repeats 22 times>}0x401d5004 in __libc_start_main () from /lib/libc.so.6Single stepping until exit from function __libc_start_main, which has no line number information.Program exited normally.