Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Using dlopen and remote debugging
@ 2008-02-25 19:29 Steve Kreyer
  2008-02-27  1:23 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Steve Kreyer @ 2008-02-25 19:29 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Unfortunately your response did not receive my email service provider til now. I had to read it over the gdb mailing list archives.
Thank you so much for this patch you've suggested there! I've searched nearly 2 days for a solution about this issue, now it works!

Thanks,
Steve


-----Ursprüngliche Nachricht-----
Von: <steve.kreyer@web.de>
Gesendet: 25.02.08 15:23:27
An:  "Dr. Rolf Jansen" <rj@surtec.com>
CC: gdb@sourceware.org
Betreff: Re: Using dlopen and remote debugging


Hi Daniel, hello Rolf,

first, thanks for your answers, but I am afraid Daniel is right. "info shared" says:
  (gdb) c
  Continuing.

  Breakpoint 1, main () at test2.c:12
  12          lib_handle = dlopen("/libtest.so", RTLD_NOW);
  (gdb) n
  13          foop = dlsym(lib_handle, "foo");
  (gdb) info shared
  No shared libraries loaded at this time.

Is there anything else I can do to debug this library using the gdb sh port?

Thanks and regards,
Steve

-----Ursprüngliche Nachricht-----
Von: "Daniel Jacobowitz" <drow@false.org>
Gesendet: 25.02.08 14:30:52
An: Steve Kreyer <steve.kreyer@web.de>
CC: gdb@sourceware.org
Betreff: Re: Using dlopen and remote debugging


On Mon, Feb 25, 2008 at 01:04:12PM +0100, Steve Kreyer wrote:
>   Breakpoint 1, main () at test2.c:12
>   12 lib_handle = dlopen("/libtest.so", RTLD_NOW);
>   (gdb) n

At this point, what does info shared say?

The SH Linux port of GDB is not well-cared-for.  I suspect it is
missing shared library support entirely.

-- 
Daniel Jacobowitz
CodeSourcery



_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! 
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114




_____________________________________________________________________
Unbegrenzter Speicherplatz für Ihr E-Mail Postfach? Jetzt aktivieren!
http://www.digitaledienste.web.de/freemail/club/lp/?lp=7


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Using dlopen and remote debugging
@ 2008-02-25 14:33 steve.kreyer
  2008-02-25 16:33 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: steve.kreyer @ 2008-02-25 14:33 UTC (permalink / raw)
  To: Daniel Jacobowitz, Dr. Rolf Jansen; +Cc: gdb

Hi Daniel, hello Rolf,

first, thanks for your answers, but I am afraid Daniel is right. "info shared" says:
  (gdb) c
  Continuing.

  Breakpoint 1, main () at test2.c:12
  12          lib_handle = dlopen("/libtest.so", RTLD_NOW);
  (gdb) n
  13          foop = dlsym(lib_handle, "foo");
  (gdb) info shared
  No shared libraries loaded at this time.

Is there anything else I can do to debug this library using the gdb sh port?

Thanks and regards,
Steve

-----Ursprüngliche Nachricht-----
Von: "Daniel Jacobowitz" <drow@false.org>
Gesendet: 25.02.08 14:30:52
An: Steve Kreyer <steve.kreyer@web.de>
CC: gdb@sourceware.org
Betreff: Re: Using dlopen and remote debugging


On Mon, Feb 25, 2008 at 01:04:12PM +0100, Steve Kreyer wrote:
>   Breakpoint 1, main () at test2.c:12
>   12 lib_handle = dlopen("/libtest.so", RTLD_NOW);
>   (gdb) n

At this point, what does info shared say?

The SH Linux port of GDB is not well-cared-for.  I suspect it is
missing shared library support entirely.

-- 
Daniel Jacobowitz
CodeSourcery



_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! 
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Using dlopen and remote debugging
@ 2008-02-25 12:15 Steve Kreyer
  2008-02-25 13:30 ` Dr. Rolf Jansen
  2008-02-25 13:32 ` Daniel Jacobowitz
  0 siblings, 2 replies; 9+ messages in thread
From: Steve Kreyer @ 2008-02-25 12:15 UTC (permalink / raw)
  To: gdb

Hi,

I have the following problem: I would like to debug a program on a remote target. This program loads a shared library with the dlopen call, but if the library is loaded, gdb on host-side doesn't find the appropriate debugging symbols of this library.
I've also tried to make use of the solib-search-path and solib-absolute-path settings but without success. Both, the application and the library, which is loaded via dlopen, are compiled using the -g switch of gcc.
I've issued the following steps:

On target side:
  $ gdbserver foo:1234 a.out

On host side:
  $ sh4-linux-uclibc-gcc -g test2.c -ldl -Wall
  $ sh4-linux-uclibc-gcc -g -shared libtest.c -o libtest.so
  $ /opt/sh4-linux-uclibc/bin/sh4-linux-uclibc-gdb a.out
  (gdb) set solib-search-path /home/skreyer
  (gdb) target remote 192.168.1.201:1234
  Remote debugging using 192.168.1.201:1234
  (gdb) b main
  Breakpoint 1 at 0x400608: file test2.c, line 12.
  (gdb) c
  Continuing.

  Breakpoint 1, main () at test2.c:12
  12 lib_handle = dlopen("/libtest.so", RTLD_NOW);
  (gdb) n
  13 foop = dlsym(lib_handle, "foo");
  (gdb) n
  15 erg = foop(1, 2);
  (gdb) p foo
  No symbol "foo" in current context.

The source code:
test2.c:
  #include <dlfcn.h>
  #include <stdio.h>

  typedef int (*funcp)(int, int);

  int main()
  {
    void *lib_handle;
    funcp foop;
    int erg;

    lib_handle = dlopen("/libtest.so", RTLD_NOW);
    foop = dlsym(lib_handle, "foo");

    erg = foop(1, 2);
    printf("%d\n", erg);

    dlclose(lib_handle);

    return 0;
  }
libtest.c:
  #include <stdio.h>

  int foo(int a, int b)
  {
    int erg;

    erg = a + b;
    return erg;
  }

Can someone give me a hint on this issue?

TIA,
Steve
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-02-27  1:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25 19:29 Using dlopen and remote debugging Steve Kreyer
2008-02-27  1:23 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2008-02-25 14:33 steve.kreyer
2008-02-25 16:33 ` Daniel Jacobowitz
2008-02-25 12:15 Steve Kreyer
2008-02-25 13:30 ` Dr. Rolf Jansen
2008-02-25 13:55   ` Daniel Jacobowitz
2008-02-25 14:23     ` Dr. Rolf Jansen
2008-02-25 13:32 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox