Skip to main content.

14.6.5. Remote 'g' packet reply is too long

Question:
I'm trying to debug U-Boot for a PPC4xx processor, but I get the following error:
(gdb) target remote xx.xx.xx.xx:2001
Remote debugging using xx.xx.xx.xx:2001

Remote 'g' packet reply is too long:...
I believe this error is caused by GDB being configured to the wrong architecture. So I did the following:
$ ppc_4xx-gdb u-boot
...
The target architecture is set automatically (currently powerpc:403)
(gdb) show arch
The target architecture is set automatically (currently powerpc:e500)
(gdb) set arch powerpc:403
The target architecture is assumed to be powerpc:e500
(gdb) show arch
The target architecture is assumed to be powerpc:e500
(gdb) set arch powerpc:common
The target architecture is assumed to be powerpc:e500
(gdb) show arch
The target architecture is assumed to be powerpc:e500
(gdb) 
As you see, initially GDB says the target architecture is "powerpc:403". But the "show arch" command claims it is the "powerpc:e500". And any commands that try to change it from "powerpc:e500" do not appear to be working.

What's wrong, and why am I not able to change the architecture?
Answer:
Some versions of GDB are hard coded to try and read the architecture from the ELF file and set the arch based on that at startup. When this happens you cannot change the arch again. In this case it looks like it has set it incorrectly from the ELF file as "powerpc:e500".
Workaround:
The following procedure can be used to work around the problem:
  • Start GDB without a file argument, i. e. do not give the the name of the ELF file (here "u-boot") on the command line
  • use "set arch" to set the appropriate architecture
  • use the "add-symbol-file" command to load the ELF file (here "u-boot") manually
  • double check using "show arch" to make sure the arch hasn't changed; change it back in case it has
  • connect to the BDI using the "target remote" commAnd as usual and start debugging
Note:
When you see this problem with the GDB version 6.7-1rh as included with ELDK release 4.2, you may want to install the update to version 6.7-4rh which can be found here: ftp://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/updates/RPMS/gdb-ppc-6.7-4.i386.rpm
14.6.4. Setting a breakpoint doesn't work 1. Abstract 14.7. Motorola LITE5200 Board
Prev Home Next