Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Unable to find dynamic linker breakpoint function.
@ 2005-02-25  8:04 Hareesh Nagarajan
  2005-02-25 17:45 ` Kris Warkentin
  0 siblings, 1 reply; 5+ messages in thread
From: Hareesh Nagarajan @ 2005-02-25  8:04 UTC (permalink / raw)
  To: GDB

Hi,

I know this question has been posted before, but I am posting this again 
because I don't know how to fix this warning;

1. warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

And then, how must I fix this problem;

2. The program being debugged stopped while in a function called from 
GDB. When the function (std::string::at(unsigned) const) is done 
executing, GDB will silently stop (instead of continuing to evaluate the 
expression containing the function call).

My gdb run appears below.

Thanks,

Hareesh

PS: I'm running GDB 6.0. libstdc++ and glibc have been compiled with 
DEBUG information.

(gdb) r
Starting program: /home/hareesh/new
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
l
Program exited normally.
(gdb) l
1       #include <iostream>
2       #include <string>
3       using namespace std;
4
5       int main(void)
6       {
7               string x("heloo");
8               cout << x.at(2);
9       }
(gdb) b 8
Breakpoint 1 at 0x80488a6: file new.cc, line 8.
(gdb) r
Starting program: /home/hareesh/new
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

Breakpoint 1, main () at new.cc:8
8               cout << x.at(2);
(gdb) inspect x
$1 = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<No 
data fields>}, _M_p = 0x804a05c "heloo"},
   static _S_empty_rep_storage = {0, 0, 0, 0}}
(gdb) inspect x.at(2)

Breakpoint 1, main () at new.cc:8
8               cout << x.at(2);
The program being debugged stopped while in a function called from GDB.
When the function (std::string::at(unsigned) const) is done executing, 
GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
(gdb)


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

* Re: Unable to find dynamic linker breakpoint function.
  2005-02-25  8:04 Unable to find dynamic linker breakpoint function Hareesh Nagarajan
@ 2005-02-25 17:45 ` Kris Warkentin
  2005-02-25 20:20   ` Hareesh Nagarajan
  0 siblings, 1 reply; 5+ messages in thread
From: Kris Warkentin @ 2005-02-25 17:45 UTC (permalink / raw)
  To: Hareesh Nagarajan; +Cc: GDB

I think you're seeing two different problems here but they may have the 
same root.  Gdb may be finding the wrong glibc - that is, not the same 
one that the program is using.  Try 'info shared' to see what gdb is using.

As far as the stop goes, string::at(2) may have been inlined in which 
case the breakpoint may well be in that code.  You might want to look at 
the assembly.  Try breaking on seven, nexting to 8 and see if you get 
the same result.  Or clear the breakpoint before calling x.at(2).  
Possibly the weird break is due to the wrong libc as above though.

cheers,

Kris

Hareesh Nagarajan wrote:

>Hi,
>
>I know this question has been posted before, but I am posting this again
>
>because I don't know how to fix this warning;
>
>1. warning: Unable to find dynamic linker breakpoint function.
>GDB will be unable to debug shared library initializers
>and track explicitly loaded dynamic code.
>
>And then, how must I fix this problem;
>
>2. The program being debugged stopped while in a function called from 
>GDB. When the function (std::string::at(unsigned) const) is done 
>executing, GDB will silently stop (instead of continuing to evaluate the
>
>expression containing the function call).
>
>My gdb run appears below.
>
>Thanks,
>
>Hareesh
>
>PS: I'm running GDB 6.0. libstdc++ and glibc have been compiled with 
>DEBUG information.
>
>(gdb) r
>Starting program: /home/hareesh/new
>warning: Unable to find dynamic linker breakpoint function.
>GDB will be unable to debug shared library initializers
>and track explicitly loaded dynamic code.
>l
>Program exited normally.
>(gdb) l
>1       #include <iostream>
>2       #include <string>
>3       using namespace std;
>4
>5       int main(void)
>6       {
>7               string x("heloo");
>8               cout << x.at(2);
>9       }
>(gdb) b 8
>Breakpoint 1 at 0x80488a6: file new.cc, line 8.
>(gdb) r
>Starting program: /home/hareesh/new
>warning: Unable to find dynamic linker breakpoint function.
>GDB will be unable to debug shared library initializers
>and track explicitly loaded dynamic code.
>
>Breakpoint 1, main () at new.cc:8
>8               cout << x.at(2);
>(gdb) inspect x
>$1 = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<No 
>data fields>}, _M_p = 0x804a05c "heloo"},
>   static _S_empty_rep_storage = {0, 0, 0, 0}}
>(gdb) inspect x.at(2)
>
>Breakpoint 1, main () at new.cc:8
>8               cout << x.at(2);
>The program being debugged stopped while in a function called from GDB.
>When the function (std::string::at(unsigned) const) is done executing, 
>GDB will silently
>stop (instead of continuing to evaluate the expression containing
>the function call).
>(gdb)
>  
>


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

* Re: Unable to find dynamic linker breakpoint function.
  2005-02-25 17:45 ` Kris Warkentin
@ 2005-02-25 20:20   ` Hareesh Nagarajan
  2005-02-25 21:00     ` Kris Warkentin
  0 siblings, 1 reply; 5+ messages in thread
From: Hareesh Nagarajan @ 2005-02-25 20:20 UTC (permalink / raw)
  To: GDB; +Cc: Kris Warkentin

Kris Warkentin wrote:
> I think you're seeing two different problems here but they may have the 
> same root.  Gdb may be finding the wrong glibc - that is, not the same 
> one that the program is using.  Try 'info shared' to see what gdb is using.

I don't know how 'info shared' helps, but this might:

hareesh: hareesh/ $ ldd new
         linux-gate.so.1 =>  (0xffffe000)
         libstdc++.so.5 => 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0xb7f0d000)
         libm.so.6 => /lib/libm.so.6 (0xb7eeb000)
         libgcc_s.so.1 => 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1 (0xb7ee2000)
         libc.so.6 => /lib/libc.so.6 (0xb7dce000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)

I have compiled libstdc++ with '-g -fomit-frame-pointer'.

Additionally, I use Gentoo Linux and that this problem of mine affects 
debugging member functions of C++ STL containers. So how could the wrong 
glibc be the problem?

> As far as the stop goes, string::at(2) may have been inlined in which 
> case the breakpoint may well be in that code.  You might want to look at 
> the assembly.  Try breaking on seven, nexting to 8 and see if you get 
> the same result.  Or clear the breakpoint before calling x.at(2).  

I did that. But that doesn't change anything as can be seen below.

Breakpoint 1, main () at new.cc:7
7               string x("heloo");
(gdb) n
8               cout << x.at(2);
(gdb) inspect x.at(2)

Breakpoint 1, main () at new.cc:7
7               string x("heloo");
The program being debugged stopped while in a function called from GDB.
When the function (std::string::at(unsigned) const) is done executing, 
GDB will silently stop (instead of continuing to evaluate the expression 
containing the function call).

I have no idea how to fix this problem and it is frankly driving me mad!

Thanks,

Hareesh


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

* Re: Unable to find dynamic linker breakpoint function.
  2005-02-25 20:20   ` Hareesh Nagarajan
@ 2005-02-25 21:00     ` Kris Warkentin
  2005-02-28 16:05       ` Hareesh Nagarajan
  0 siblings, 1 reply; 5+ messages in thread
From: Kris Warkentin @ 2005-02-25 21:00 UTC (permalink / raw)
  To: Hareesh Nagarajan; +Cc: GDB

Hareesh Nagarajan wrote:

>I have compiled libstdc++ with '-g -fomit-frame-pointer'.
>
>Additionally, I use Gentoo Linux and that this problem of mine affects 
>debugging member functions of C++ STL containers. So how could the wrong
>
>glibc be the problem?
>  
>

Actually, I was being dumb.  I forgot that Linux has the runtime linker 
in ld-linux.so.  On QNX, our linker is in our libc.  I just wanted to be 
sure that what your program was loading at runtime was exactly the same 
as what gdb was reading - hence the 'info shared'. 

>I have no idea how to fix this problem and it is frankly driving me mad!
>

Looks like it has nothing to do with your special libs.  I just tried to 
reproduce your problem and got this:

(gdb) p foo.at(2)
$1 = (const char &) @0x90f6016: 108 'l'
(gdb) p foo.at(2)

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00d27ef1 in std::string::at () from /usr/lib/libstdc++.so.5
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function 
(std::string::at(unsigned i
nt) const) will be abandoned.
(gdb)

It worked the first time and then failed the second time.  Looks like 
the dummy frame and supporting breakpoints are left over:

(gdb) maint info breakpoints
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x08048905 in main at seeplus.cc:8
        breakpoint already hit 1 time
-2  shlib events   keep y   0x006f44a0 <_dl_debug_state>
        breakpoint already hit 3 times
-10 longjmp        keep n   0x006f7920 <longjmp>
-11 longjmp        keep n   0x00727c60 <siglongjmp>
-12 longjmp        keep n   0x00727c60 <siglongjmp>
-13 longjmp resume keep n   0x00000000
0   call dummy     del  y   0x08048844 <_start>
        stop only in stack frame at 0xbfe8300c

Ick.  If I put 'set unwindsignal on', at least the program isn't hosed 
when it chokes.  Looks like the same problem as PR:1766:

http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1766&return_url=http%3A%2F%2Fsources.redhat.com%2Fcgi-bin%2Fgnatsweb.pl%3Fdatabase%3Dgdb%26category%3Dc%252B%252B%26severity%3Dall%26priority%3Dall%26responsible%3Dall%26submitter_id%3Dall%26state%3Dall%26ignoreclosed%3DIgnore%2520Closed%26class%3Dall%26synopsis%3D%26multitext%3D%26columns%3Dcategory%26columns%3Dstate%26columns%3Dclass%26columns%3Dresponsible%26columns%3Dsynopsis%26displaydate%3DDisplay%2520Current%2520Date%26cmd%3Dsubmit%2520query%26sortby%3DResponsible%26.cgifields%3Ddisplaydate%26.cgifields%3Dignoreclosed%26.cgifields%3Doriginatedbyme%26.cgifields%3Dcolumns

Don't know what else to tell you.  Known problem.  Don't do that.  We'll 
fix it RSN.  Sorry.

cheers,

Kris


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

* Re: Unable to find dynamic linker breakpoint function.
  2005-02-25 21:00     ` Kris Warkentin
@ 2005-02-28 16:05       ` Hareesh Nagarajan
  0 siblings, 0 replies; 5+ messages in thread
From: Hareesh Nagarajan @ 2005-02-28 16:05 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: GDB

Kris Warkentin wrote:
> Looks like it has nothing to do with your special libs.  I just tried to 
> reproduce your problem and got this:

Yeah it looks like it has nothing to do with the libs such as libstdc++.
Below I've written a simple program called 'new2.cc'

<new2.cc>

#include <iostream>
using namespace std;

class X
{
     int xx;
public:
     X(int _xx) {xx = _xx;}
     void display(void) { cout << xx; };
};


int main(void)
{
         X xobj(2);
         xobj.display(); 	// Line 15
}

</new2.cc>

I compiled it as follows: g++ new2.cc -onew2 -g

When I break it on line 15, I get the same problem as PR1766
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1766&return_url=http%3A%2F%2Fsources.redhat.com%2Fcgi-bin%2Fgnatsweb.pl%3Fdatabase%3Dgdb%26category%3Dc%252B%252B%26severity%3Dall%26priority%3Dall%26responsible%3Dall%26submitter_id%3Dall%26state%3Dall%26ignoreclosed%3DIgnore%2520Closed%26class%3Dall%26synopsis%3D%26multitext%3D%26columns%3Dcategory%26columns%3Dstate%26columns%3Dclass%26columns%3Dresponsible%26columns%3Dsynopsis%26displaydate%3DDisplay%2520Current%2520Date%26cmd%3Dsubmit%2520query%26sortby%3DResponsible%26.cgifields%3Ddisplaydate%26.cgifields%3Dignoreclosed%26.cgifields%3Doriginatedbyme%26.cgifields%3Dcolumns

<error>
(gdb) b 15
Breakpoint 1 at 0x8048654: file new2.cc, line 15.
(gdb) r
Starting program: /home/hareesh/new2
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

Breakpoint 1, main () at new2.cc:15
15              X xobj(2);
(gdb) n
16              xobj.display();
(gdb) inspect xobj.display()

Breakpoint 1, main () at new2.cc:15
15              X xobj(2);
The program being debugged stopped while in a function called from GDB.
When the function (X::display()) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
</error>

My question is, how come GDB doesn't stop on other boxes when I inspect 
a member function and it stops on mine :( ?

Thanks,

Hareesh


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

end of thread, other threads:[~2005-02-25 21:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-25  8:04 Unable to find dynamic linker breakpoint function Hareesh Nagarajan
2005-02-25 17:45 ` Kris Warkentin
2005-02-25 20:20   ` Hareesh Nagarajan
2005-02-25 21:00     ` Kris Warkentin
2005-02-28 16:05       ` Hareesh Nagarajan

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