[uClibc] gdbserver on arm?

Caj Nordström caj.nordstrom at beamex.com
Thu Jan 20 11:52:08 UTC 2005


I finally solved my own problem. It was a very easy fault but when the 
error message was
on the target I did not realize that the problem was in the host. Insight 
is quite good in hiding
error messages. But after using plain gdb I noticed that this command helps:

set solib-absolute-prefix /path-to-target-system

After this command everything works!

Caj

At 11:19 AM 11/19/2004 +0200, Caj Nordström wrote:
>Hi
>As I reported in a mail 23.9.2004 with subject: error initializing 
>thread_db library
>I have also problem with threading in arm.
>Do you also have this error message on target after connection prom PC and
>exec command continue?
>
>gdb: error initializing thread_db library.
>
>I can debug the main thread but it do not find breakpoints in other threads.
>
>Caj
>
>uclibc at uclibc.org
>At 03:46 PM 11/18/2004 -0500, you wrote:
>
>>  Hey, have something here that seems to me as if I'm missing something 
>> obvious, but am just not getting it.  So far I've been unable to get a 
>> gdbserver session going properly on an ARM-based chip (ARM922T core), 
>> when connected from the matching arm-linux-uclibc-gdb - both buildroot created.
>>
>>  After pulling the buildroot (both and older one and the latest one for 
>> sanity) and doing a simple build with both target gdb and gdbserver, I 
>> can boot off the generated image.  I can launch gdb on the target with a 
>> small test executable and it works beautifully.  It indicates that it's 
>> loading the threading library, so am assuming that thread support is 
>> happy as well (this is good - I'll need it later..)  The problem comes 
>> in when I try to debug an application that is just too big for gdb and 
>> the app at the same time on the target: A perfect opportunity for 
>> gdbserver, right?
>>
>>  I have a test program that is a simple loop, something to just step 
>> through as it prints numbers.  So a standard invocation of gdbserver on 
>> the target:
>>
>>gdbserver host:1234 test
>>Process test created; pid = 142
>>
>>  On the PC:
>>
>>arm-linux-uclibc-gdb test
>>
>>GNU gdb 6.2.1
>>Copyright 2004 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-pc-linux-gnu 
>>--target=arm-linux-uclibc"...
>>(gdb) target remote 192.168.192.214:1234
>>Remote debugging using 192.168.192.214:1234
>>0x4000106c in ?? ()
>>warning: Unable to find dynamic linker breakpoint function.
>>GDB will be unable to debug shared library initializers
>>and track explicitly loaded dynamic code.
>>(gdb) break main
>>Breakpoint 1 at 0x8494: file test.c, line 5.
>>(gdb) cont
>>Continuing.
>>Error while mapping shared library sections:
>>/lib/libc.so.0: No such file or directory.
>>Error while mapping shared library sections:
>>/lib/ld-uClibc.so.0: No such file or directory.
>>Error while reading shared library symbols:
>>/lib/libc.so.0: No such file or directory.
>>Error while reading shared library symbols:
>>/lib/ld-uClibc.so.0: No such file or directory.
>>
>>(gdb) load [fully qualified path]/lib/libc.so.0
>>Loading section .hash, size 0x25ac lma 0xd4
>>Memory access error while loading section .hash.
>>
>>Breakpoint 1, main (argc=1, argv=0xbffffed4) at test.c:5
>>5         int n = 0;
>>(gdb) print n
>>$1 = 1
>>(gdb) step
>>Cannot access memory at address 0x0
>>7         for(n = 0; n < 10; n++) {
>>(gdb)
>>Cannot access memory at address 0x0
>>8           printf("%d\n", n);
>>(gdb)
>>Segmentation fault
>>
>>
>>OK, so there are a few things here:
>>1) Couldn't load dynamic linker?
>>2) Couldn't find libraries to load?
>>3) Couldn't load libraries given a full path?
>>4) The most obvious: dies trying to step through code.
>>
>>Am at a loss, and could really use the tools.  Google for gdbserver and 
>>uClibc doesn't yield much, neither do the gdb errors google out to 
>>anything useful (so far, am still looking..)
>>
>>Advice?
>>
>>
>>_______________________________________________
>>uClibc mailing list
>>uClibc at uclibc.org
>>http://uclibc.org/mailman/listinfo/uclibc
>
>
>
>
>_______________________________________________
>uClibc mailing list
>uClibc at uclibc.org
>http://uclibc.org/mailman/listinfo/uclibc





More information about the uClibc mailing list