public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* dlopen()
@ 2006-01-17  5:54 Russell Shaw
  2006-01-17  6:00 ` dlopen() Jim Blandy
  2006-01-17  6:12 ` dlopen() Russell Shaw
  0 siblings, 2 replies; 4+ messages in thread
From: Russell Shaw @ 2006-01-17  5:54 UTC (permalink / raw)
  To: gdb

Hi,

I do:

   void *handle = dlopen("libfile1.so", RTLD_NOW);
   ...
   newfunc = dlsym(handle, "afunc");
   ...
   int res = (*newfunc)(app);

How do i stop inside the "newfunc" function? I set a breakpoint
there, but it doesn't activate.

I'm using GNU gdb 6.3-debian on a pc.
I compiled with CFLAGS="-g -O0".

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

* Re: dlopen()
  2006-01-17  5:54 dlopen() Russell Shaw
@ 2006-01-17  6:00 ` Jim Blandy
  2006-01-17 21:28   ` dlopen() Russell Shaw
  2006-01-17  6:12 ` dlopen() Russell Shaw
  1 sibling, 1 reply; 4+ messages in thread
From: Jim Blandy @ 2006-01-17  6:00 UTC (permalink / raw)
  To: Russell Shaw; +Cc: gdb

On 1/16/06, Russell Shaw <rjshaw@netspace.net.au> wrote:
> Hi,
>
> I do:
>
>    void *handle = dlopen("libfile1.so", RTLD_NOW);
>    ...
>    newfunc = dlsym(handle, "afunc");
>    ...
>    int res = (*newfunc)(app);
>
> How do i stop inside the "newfunc" function? I set a breakpoint
> there, but it doesn't activate.

After you step over the dlopen call, GDB should have read the symbols
from libfile1.so.  If you say "break afunc" at that point, what does
GDB say?

If that doesn't work for you, you'll need to give us more details. 
You need to include an actual transcript of your GDB session to start
with, not just an English description of what you did and what
happened.  If we don't see any misunderstandings there, then you'll
need to provide us with a test case we can use to make the problem
happen on our own machines.

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

* Re: dlopen()
  2006-01-17  5:54 dlopen() Russell Shaw
  2006-01-17  6:00 ` dlopen() Jim Blandy
@ 2006-01-17  6:12 ` Russell Shaw
  1 sibling, 0 replies; 4+ messages in thread
From: Russell Shaw @ 2006-01-17  6:12 UTC (permalink / raw)
  Cc: gdb

Russell Shaw wrote:
> Hi,
> 
> I do:
> 
>   void *handle = dlopen("libfile1.so", RTLD_NOW);
>   ...
>   newfunc = dlsym(handle, "afunc");
>   ...
>   int res = (*newfunc)(app);
> 
> How do i stop inside the "newfunc" function? I set a breakpoint
> there, but it doesn't activate.
> 
> I'm using GNU gdb 6.3-debian on a pc.
> I compiled with CFLAGS="-g -O0".

For some reason, it is working now. I'm also using gdb-6.4 now.

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

* Re: dlopen()
  2006-01-17  6:00 ` dlopen() Jim Blandy
@ 2006-01-17 21:28   ` Russell Shaw
  0 siblings, 0 replies; 4+ messages in thread
From: Russell Shaw @ 2006-01-17 21:28 UTC (permalink / raw)
  Cc: gdb

Jim Blandy wrote:
> On 1/16/06, Russell Shaw <rjshaw@netspace.net.au> wrote:
> 
>>Hi,
>>
>>I do:
>>
>>   void *handle = dlopen("libfile1.so", RTLD_NOW);
>>   ...
>>   newfunc = dlsym(handle, "afunc");
>>   ...
>>   int res = (*newfunc)(app);
>>
>>How do i stop inside the "newfunc" function? I set a breakpoint
>>there, but it doesn't activate.
> 
> After you step over the dlopen call, GDB should have read the symbols
> from libfile1.so.  If you say "break afunc" at that point, what does
> GDB say?
> 
> If that doesn't work for you, you'll need to give us more details. 
> You need to include an actual transcript of your GDB session to start
> with, not just an English description of what you did and what
> happened.  If we don't see any misunderstandings there, then you'll
> need to provide us with a test case we can use to make the problem
> happen on our own machines.

It works now, for some reason. After dlopen(), "info shared" shows that
the symbols are read.

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

end of thread, other threads:[~2006-01-17  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17  5:54 dlopen() Russell Shaw
2006-01-17  6:00 ` dlopen() Jim Blandy
2006-01-17 21:28   ` dlopen() Russell Shaw
2006-01-17  6:12 ` dlopen() Russell Shaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).