RE: [U-Boot-Users] Using the abatron to debug an image in flash

Dear Wolfgang,
Accessing normal static variables should be no problem. It's just initialized data pointers which need manual relocation. I try to avoid this data type whenever possible, or we need to relocate it. If you find unrelocated initialized pointers please let me know.
But accessing the variables itself should work just fine - if they are pointers, they will just contain unrelocated addresses.
I have loaded the symbol file as mentioned previously, however to my unexperienced eye it appears that some of the symbols for the static variables have not been loaded where I would have expected ...
$ ppc-linux-gdb GNU gdb 5.1.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux". (gdb) bdi 0xff000100 in ?? () (gdb) ram add symbol table from file "u-boot" at .text_addr = 0x7fc0000 (gdb) info address rtx Symbol "rtx" is static storage at address 0xff0312d8. (gdb)
In the unlikely case you are not aware rtx is defined in cpu/mpc8260/ether_fcc.c as ...
<snip> /* * FCC Ethernet Tx and Rx buffer descriptors. * Provide for Double Buffering * Note: PKTBUFSRX is defined in net.h */
typedef volatile struct rtxbd { cbd_t rxbd[PKTBUFSRX]; cbd_t txbd[TX_BUF_CNT]; } RTXBD;
/* Good news: the FCC supports external BDs! */ #ifdef __GNUC__ static RTXBD rtx __attribute__ ((aligned(8))); #else #error "rtx must be 64-bit aligned" #endif <snip>
Is this what you would normally expect? When I scan the assembler the code uses the correct address, it appears that the gdb however is a bit lost.
Best wishes,
Mark.

Dear Mark,
in message 9901EE1E8F8BD3119109009027A1B5F596AE43@DIGINET2 you wrote:
$ ppc-linux-gdb
Is this really how you called GDB?
GNU gdb 5.1.1
Where did you get this GDB from?
This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux". (gdb) bdi 0xff000100 in ?? () (gdb) ram add symbol table from file "u-boot" at .text_addr = 0x7fc0000 (gdb) info address rtx Symbol "rtx" is static storage at address 0xff0312d8. (gdb)
In the unlikely case you are not aware rtx is defined in cpu/mpc8260/ether_fcc.c as ...
The same works fine here:
-> ppc_8xx-gdb GNU gdb 5.1.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux". (gdb) add-symbol-file boot 0x7fc0000 add symbol table from file "boot" at .text_addr = 0x7fc0000 (y or n) y boot: No such file or directory. (gdb) add-symbol-file u-boot 0x7fc0000 add symbol table from file "u-boot" at .text_addr = 0x7fc0000 (y or n) y Reading symbols from u-boot...done. (gdb) p &_start $1 = (<text variable, no debug info> *) 0x7fc0100 <_start> (gdb) p &rtx $2 = (struct rtxbd *) 0x7fe20e0 (gdb) info address rtx Symbol "rtx" is static storage at address 0x7fe20e0.
And just to verify without relocation:
(gdb) symbol-file Discard symbol table from `current image(s)'? (y or n) y No symbol file now. (gdb) symbol-file u-boot Reading symbols from u-boot...done. (gdb) info address rtx Symbol "rtx" is static storage at address 0x400220e0. (gdb)
Best regards,
Wolfgang Denk
participants (2)
-
Mark Doherty
-
Wolfgang Denk