Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Alexandre Oliva <aoliva@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: GDB 5.0 won't build on GNU/Linux/sparc
Date: Sat, 20 May 2000 10:08:00 -0000	[thread overview]
Message-ID: <3926C5C8.7569@cygnus.com> (raw)
In-Reply-To: <oraehlelgf.fsf@tamanduatei.dcc.unicamp.br>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 8705 bytes --]

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  <aoliva@cygnus.com>
> 
>         * 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 <nm-sysv4.h>
> +#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 <ac131313@cygnus.com>
To: Alexandre Oliva <aoliva@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com, Kevin Buettner <kevinb@cygnus.com>
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: <oraehlelgf.fsf@tamanduatei.dcc.unicamp.br>
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 <ac131313@cygnus.com>
To: Alexandre Oliva <aoliva@cygnus.com>
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: <oraehlelgf.fsf@tamanduatei.dcc.unicamp.br> <ork8gpd00h.fsf@tamanduatei.dcc.unicamp.br>
X-SW-Source: 2000-05/msg00317.html
Content-length: 1107

Alexandre Oliva wrote:
> 
> On May 20, 2000, Alexandre Oliva <aoliva@cygnus.com> 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  <aoliva@cygnus.com>
> 
>         * 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 <kettenis@wins.uva.nl>
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  <kettenis@gnu.org>

	* 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


  parent reply	other threads:[~2000-05-20 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <oraehlelgf.fsf@tamanduatei.dcc.unicamp.br>
2000-05-20  2:49 ` Alexandre Oliva
     [not found]   ` <392730E1.22BE968B@cygnus.com>
2000-05-21  9:25     ` Michael Snyder
2000-05-22 13:36     ` Alexandre Oliva
2000-05-20 10:08 ` Michael Snyder [this message]
2000-05-22 19:12 ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3926C5C8.7569@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=aoliva@cygnus.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox