I don't know why GDB thinks it's just one byte long, but you can force a different number of bytes to be printed by using the @ postfix. I didn't check if it works, but I think something like this might work:
print/x *(0x160)@4 Come to think about it, maybe the problem here is that gdb just sees the asm(0x160) and assumes it is a byte pointer, somehow losing the notion that 0x160 is a pointer to int. On Sun, Feb 21, 2010 at 9:12 AM, Tyler Daniel <[email protected]>wrote: > Hi all, > > gdb 7.0 from the gcc 4.4.2 distribution seems to think that TA0CTL is > 1 byte long when printing the value. I built the following code as a > test and verified that it does actually do the right thing, but > "print /x TA0CTL" only gives the lower byte, which is always zero in > this case. > > I'm compiling with -g to include debugging info. > (And note that TACTL is #defined to be TA0CTL, which should be defined > as "volatile unsigned int TA0CTL asm("0x160")") > > Any ideas would be most appreciated! > > Tyler > > ---------- code > > #include <io.h> > > int > main() > { > // Stop watchdog timer to prevent time out reset > WDTCTL = WDTPW + WDTHOLD; > > TACTL = TASSEL1; > > while (1) > { > } > } > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users >
