This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: SHARED LIBS
- To: Jason Molenda <jsm at cygnus dot com>
- Subject: Re: SHARED LIBS
- From: Steinar Bang <sb at metis dot no>
- Date: 11 Jan 2000 11:32:00 +0100
- Cc: Bryce McKinlay <bryce at albatross dot co dot nz>, Takis Psarogiannakopoulos <takis at XFree86 dot org>, gdb at sourceware dot cygnus dot com
- Organization: NCR METIS
- References: <Pine.BSF.4.05.9912171549080.11097-200000@public.xfree86.org> <385AF8A8.95EF6BD4@albatross.co.nz> <whaemckir8.fsf@totally-fudged-out-message-id>
[Please cc me in any responses, as I'm not on the gdb list. Thanx!]
On Fri, 17 Dec 1999 22:34:07 -0800, Jason Molenda wrote:
[...]
> This is a recent change in behavior--it seems that GDB is now trying
> to insert the breakpoint when the user uses the 'break' command,
> whereas it used to insert the breakpoint when GDB went to resume (or
> start) execution.
> I'll try to look at it this weekend, but it's looking busy. :-/ Does
> this problem ring a bell with anyone who has been making changes
> recently?
Hm... are you sure this isn't older than the most recent sources? I have
what may be related problems in gdb-4.18 as delivered with SuSE linux
6.2 (one similarity is that the shared command seems to do nothing):
1. individual source files in shared libraries are not known until
you get to the main function
(gdb) shared
(gdb) break karbitraryxmlhandler.cpp:116
No source file named karbitraryxmlhandler.cpp.
(gdb) break main
Breakpoint 1 at 0x804e58b
(gdb) r
Starting program: /home/sb/2x/bin/metis
Breakpoint 1, 0x804e58b in main ()
(gdb) break karbitraryxmlhandler.cpp:116
Breakpoint 2 at 0x410eccf0: file xml/karbitraryxmlhandler.cpp, line 116.
(gdb) c
Continuing.
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
Breakpoint 2, KArbitraryXmlHandler::Rep::Rep (this=0x8289958, url=0x82fb050)
at xml/karbitraryxmlhandler.cpp:116
Current language: auto; currently c++
(gdb)
This behaviour has been there for a while. It was present in
4.17 as well. You either has to break on main or run the program
through once to be allowed to set breakpoints in shared libs
2. the program being debugged, crashes if you try to start it with
breakpoints in shared libs enabled:
(gdb) r
Starting program: /home/sb/2x/bin/metis
/home/sb/2x/bin/metis: error in loading shared libraries: libmetis_kernel.so.1: failed to map segment from shared object: Cannot allocate memory
Program exited with code 0177.
(gdb)
3. If you disable the breakpoints, you will get warnings about gdb
failing to reinsert the breakpoints automatically, and you will
have to reenable them manually, after stopping in main():
(gdb) dis 2
(gdb) r
Starting program: /home/sb/2x/bin/metis
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Error in re-setting breakpoint 2:
No source file named karbitraryxmlhandler.cpp.
Breakpoint 1, 0x804e58b in main ()
Current language: auto; currently c
(gdb) ena 2
(gdb) c
Continuing.
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
Breakpoint 2, KArbitraryXmlHandler::Rep::Rep (this=0x8311c10, url=0x811b768)
at xml/karbitraryxmlhandler.cpp:116
Current language: auto; currently c++
(gdb)
This is inconvenient. In gdb-4.17 one could leave them enabled
and gdb would disable them at startup, and reenable them after
they became available
Note that the program being debugged was a C++ program.