Alexandre Oliva wrote: > > gdb/sparc-tdep.c contains code in supply_gregset() and fill_gregset() > that will only compile on Solaris/sparc. glibc doesn't define > prgreg_t, R_I7, R_PS, R_PC, R_nPC nor R_Y. In fact, registers from i0 > to i7 aren't even available in glibc's gregset. The solution is to > disable USE_PROC_FS, which can be accomplished by #including the > generic config/nm-linux.h from config/sparc/nm-linux.h, as all other > architecture-specific `nm-linux.h's do (actually, it's also missing > from config/powerpc/nm-linux.h). Unfortunately, I don't have access to a > GNU/Linux/powerpc platform to test the second change. On > GNU/Linux/sparc, it builds correctly, but it still doesn't work :-( > child_resume is called with step==1, and aborts because > SOFTWARE_SINGLE_STEP_P is also 1. I'm investigating. Meanwhile, ok > to install? Release branch? I'm not the sparc maintainer, but I did commit the changes that caused you problems. Sorry about that. Your solution seems correct -- I'll also have a look at using a few more ifdefs in my new code. Michael Snyder > --------------------------------------------------------------- > Index: gdb/ChangeLog > from Alexandre Oliva > > * config/sparc/nm-linux.h: Include config/nm-linux.h. > * config/powerpc/nm-linux.h: Likewise. > > Index: gdb/config/sparc/nm-linux.h > =================================================================== > RCS file: /cvs/src/src/gdb/config/sparc/nm-linux.h,v > retrieving revision 1.1.1.3 > diff -u -r1.1.1.3 nm-linux.h > --- gdb/config/sparc/nm-linux.h 1999/12/07 03:56:12 1.1.1.3 > +++ gdb/config/sparc/nm-linux.h 2000/05/20 07:06:17 > @@ -1,5 +1,5 @@ > /* Macro definitions for running gdb on a Sparc running Linux. > - Copyright (C) 1989, 1992, 1996, 1998 Free Software Foundation, Inc. > + Copyright (C) 1989, 1992, 1996, 1998, 2000 Free Software Foundation, Inc. > > This file is part of GDB. > > @@ -19,6 +19,7 @@ > Boston, MA 02111-1307, USA. */ > > #include > +#include "nm-linux.h" > #include "solib.h" > > #define FETCH_INFERIOR_REGISTERS > Index: gdb/config/powerpc/nm-linux.h > =================================================================== > RCS file: /cvs/src/src/gdb/config/powerpc/nm-linux.h,v > retrieving revision 1.1 > diff -u -r1.1 nm-linux.h > --- gdb/config/powerpc/nm-linux.h 2000/02/22 01:19:11 1.1 > +++ gdb/config/powerpc/nm-linux.h 2000/05/20 07:06:17 > @@ -18,6 +18,9 @@ > Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ > > #ifndef NM_LINUX_H > + > +#include "nm-linux.h" > + > #define NM_LINUX_H > > /* Return sizeof user struct to callers in less machine dependent routines */ > > --------------------------------------------------------------- > > -- > Alexandre Oliva Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/ > Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com > Free Software Developer and Evangelist CS PhD student at IC-Unicamp > oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me From ac131313@cygnus.com Sat May 20 17:30:00 2000 From: Andrew Cagney To: Alexandre Oliva Cc: gdb-patches@sourceware.cygnus.com, Kevin Buettner Subject: Re: GDB 5.0 won't build on GNU/Linux/sparc Date: Sat, 20 May 2000 17:30:00 -0000 Message-id: <39272DDF.5E6FB83A@cygnus.com> References: X-SW-Source: 2000-05/msg00316.html Content-length: 1046 Alexandre Oliva wrote: > > gdb/sparc-tdep.c contains code in supply_gregset() and fill_gregset() > that will only compile on Solaris/sparc. glibc doesn't define > prgreg_t, R_I7, R_PS, R_PC, R_nPC nor R_Y. In fact, registers from i0 > to i7 aren't even available in glibc's gregset. The solution is to > disable USE_PROC_FS, which can be accomplished by #including the > generic config/nm-linux.h from config/sparc/nm-linux.h, as all other > architecture-specific `nm-linux.h's do (actually, it's also missing > from config/powerpc/nm-linux.h). Unfortunately, I don't have access to a > GNU/Linux/powerpc platform to test the second change. On > GNU/Linux/sparc, it builds correctly, but it still doesn't work :-( > child_resume is called with step==1, and aborts because > SOFTWARE_SINGLE_STEP_P is also 1. I'm investigating. Meanwhile, ok > to install? Release branch? Just the Linux/SPARC part of this patch is approved for the 5.0 branch. It's up to Kevin Buettner decide what to do with the ppc part (w.r.t 5.0). Thanks! Andrew From ac131313@cygnus.com Sat May 20 17:43:00 2000 From: Andrew Cagney To: Alexandre Oliva Cc: gdb-patches@sourceware.cygnus.com Subject: Re: GDB 5.0 won't build on GNU/Linux/sparc Date: Sat, 20 May 2000 17:43:00 -0000 Message-id: <392730E1.22BE968B@cygnus.com> References: X-SW-Source: 2000-05/msg00317.html Content-length: 1107 Alexandre Oliva wrote: > > On May 20, 2000, Alexandre Oliva wrote: > > > On GNU/Linux/sparc, it builds correctly, but it still doesn't work > > :-( child_resume is called with step==1, and aborts because > > SOFTWARE_SINGLE_STEP_P is also 1. > > This patch fixes this problem, and now it appears to work (not that I > have tested it extensively!) > > The problem was that, when resume issued the software single step > command, it cleared `step'. Later on, it would test whether step was > zero and think it had been asked to `continue'. Ok to install? > > ------------------------------------------------------------------------ > Index: gdb/ChangeLog > from Alexandre Oliva > > * infrun.c (resume): Do not change continue to step if we single > step on software. I think this one needs more testing (wfi is dangerous at the best of times). Does anyone with one of the other targets with SOFTWARE_SINGLE_STEP_P=1 see this problem (wince, rs6000?, sunos4?). (Alexandre, can you provide a concrete example as a reference point). Andrew From kettenis@wins.uva.nl Sun May 21 05:38:00 2000 From: Mark Kettenis To: gdb-patches@sourceware.cygnus.com Cc: jimb@cygnus.com Subject: [RFA] Fall back on dynamic symtab in solib.c:bdf_lookup_symbol Date: Sun, 21 May 2000 05:38:00 -0000 Message-id: <200005211238.e4LCcd100663@delius.kettenis.local> X-SW-Source: 2000-05/msg00318.html Content-length: 2132 It turns out that the dynamic linker on FreeBSD is stripped by default. Since bfd_lookup_symbol() only checks the normal symbol table, which isn't present in a stripped shared object, this means that on FreeBSD the initial solib_event breakpoint cannot be set. This patch makes bfd_lookup_symbol() fall back on the dynamic symtab, which works since r_debug_state() is exported on FreeBSD. OK to check this in? Mark P.S. By the way, it somwhat surprised me to see that the sybol table in the dynamic linker on Solaris isn't stripped. They probably need the symbols for their librtld_db debugging interface. P.P.S. It also surprises me that apparently, none of the Linux distributions is stripping their dynamic linker. 2000-05-21 Mark Kettenis * solib.c (bfd_lookup_symbol): Fall back on the dynamic symbol table if the symbol couldn't be found in the normal symbol table (i.e. if the shared object in question was stripped). Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.14 diff -u -p -r1.14 solib.c --- solib.c 2000/05/16 04:07:39 1.14 +++ solib.c 2000/05/21 12:26:33 @@ -545,7 +545,35 @@ bfd_lookup_symbol (abfd, symname) } do_cleanups (back_to); } - return (symaddr); + + if (symaddr) + return symaddr; + + /* On FreeBSD, the dynamic linker is stripped by default. So we'll + have to check the dynamic string table too. */ + + storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd); + + if (storage_needed > 0) + { + symbol_table = (asymbol **) xmalloc (storage_needed); + back_to = make_cleanup (free, (PTR) symbol_table); + number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table); + + for (i = 0; i < number_of_symbols; i++) + { + sym = *symbol_table++; + if (STREQ (sym->name, symname)) + { + /* Bfd symbols are section relative. */ + symaddr = sym->value + sym->section->vma; + break; + } + } + do_cleanups (back_to); + } + + return symaddr; } #ifdef HANDLE_SVR4_EXEC_EMULATORS