I get the following error message when executing remote GDB commands:
(gdb) break main
Remote 'g' packet reply is too long: 00000000381f87be000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000501e87be00000000b0070040100000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000
Some background information:
I'm trying to debug a simple "hello world" program on an EVM running an AM389x (Arm Cortex A-8). My host machine is a x86 box running Ubuntu 10.04. The distro that I received did not include gdb or gdbserver so I had to build it. I built gdb and gdbserver using the gdb-7.2 source tree. The error that I'm experiencing could easily be introduced in this step. Here is how I build the gdb and gdbserver:
1. Download gdb-7.2
2. Untar the sources in a directory called gdb-7.2
3. Make a gdb_client directory for the gdb program. gdb-7.2/gdb_client
4. Make sure the CC environment variable is cleared (or set to the gcc for the Linux host machine). This will make sure gdb is built with the correct compiler in step 5.
5. CD into gdb_client and run the configure command: ../configure --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi
6. run 'make' on the make file that was created in step 5 (this will build gdb)
7. Back in the main GDB directory (gdb-7.2), create a gdb_server directory. gdb-7.2/gdb_server
8. Make sure the CC environment variable is set to point to the gcc for the ARM tool chain. In my case CC=/home/foo/CodeSourcery/arm-2009q1/bin/arm-none-linux-gnueabi-gcc. This will make sure the gdbserver is built with the arm toolchain.
9. CD into gdb_server and run the configure command for the gdbserver: ../gdb/gdbserver/configure --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi
10. Run 'make' on the make file that was created in step 9 (this will build gdbserver)
Once this is done I moved the gdbserver to my target machine's /bin folder. Next I built a debug version of my "Hello World" program using the -g option. This program was compiled using the arm cross-compiler used in step 8 above. I moved the debug "Hello World" program over to my target machine and verified it worked. After that I ran the gdbserver with the following command: gdbserver x.x.x.x:10000 ./HelloWorld.out
At this point everything looks good on the target side. I get the following message on my console:
Process HelloWorld.out created; PID = 848
Listening on port 10000
Now, on the host side I execute gdb with my HelloWorld debug program (targeted for the ARM) using the following command: ./gdb ./HelloWorld.out
Here is the output from this command:
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/cognoid/GDB/gdb-7.2/arm_linux_gnu_target_client/gdb/a.out...done.
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
.gdbinit:8: Error in sourced command file:
Argument required (one or more breakpoint numbers).