This is the mail archive of the gdb-testers@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb-980122 behavior on linux with shared libraries



I have a tentative solution (which I don't fully understand
why its only showing up on elf).

Between 970507 and now, in solib.c the
	flag solib_cleanup_queued
	function  do_clear_solib
was added...

What's happening is inbetween runs, all mappings to shared
libraries are erased, so the next run, the breakpoints are
queried and the question is asked:
	is this a breakpoint in a shared library?
newer gdb's don't retain any information about shared libraries,
so the answer is no.

This worked for now...I don't understand why it was added
: leisner@dw;rcsdiff -u solib.c
===================================================================
RCS file: solib.c,v
retrieving revision 1.1
diff -u -r1.1 solib.c
--- solib.c     1998/02/01 20:07:55     1.1
+++ solib.c     1998/02/01 20:10:30
@@ -946,11 +946,13 @@
        {
          so_list_head = new;
 
+#if 0
          if (! solib_cleanup_queued)
            {
              make_run_cleanup (do_clear_solib);
              solib_cleanup_queued = 1;
            }
+#endif
          
        }      
       so_list_next = new;

In the changelog:
Tue Sep 16 19:56:23 1997  Per Bothner  <bothner@cygnus.com>


        * solib.c (find_solib):  Register cleanup to call clear_solib
        on a new 'run' command.





In message <m0xxxVH-0004ecC@ocean.lucon.org>,   you write:
>> 
>> 
>> Can you check gdb 4.16 on solaris?
>> 
>
>It is the same as on Linux:
>
>GDB is free software and you are welcome to 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.
>GDB 4.16 (sparc-sun-solaris2.4), 
>Copyright 1996 Free Software Foundation, Inc...
>(gdb) b main
>Breakpoint 1 at 0x10898: file e.cc, line 5.
>(gdb) r
>Starting program: /home/hlu/tmp/a.out 
> 
>Breakpoint 1, main () at e.cc:5
>5         cout << "Hellow world" << endl;
>(gdb) step
>ostream::operator<< (this=0x20b30, s=0x10978 "Hellow world")
>    at /home/hlu/gnu/import/egcs/libio/iostream.cc:756
>756       if (opfx())
>(gdb) b
>Breakpoint 2 at 0xef7727e0: file
>/home/hlu/gnu/import/egcs/libio/iostream.cc, line 756.
>(gdb) r
>The program being debugged has been started already.
>Start it from the beginning? (y or n) y
>Starting program: /home/hlu/tmp/a.out 
>Cannot insert breakpoint 2:
>Temporarily disabling shared library breakpoints:
>2 
> 
>Breakpoint 1, main () at e.cc:5
>5         cout << "Hellow world" << endl;
>(gdb) c
>Continuing.
> 
>Breakpoint 2, ostream::operator<< (this=0x20b30, s=0x10978 "Hellow
>world")
>    at /home/hlu/gnu/import/egcs/libio/iostream.cc:756
>756       if (opfx())
>(gdb)
>
>I think it is an ELF problem.
>
>H.J.