This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

checked in: New unit sparc-sol-thread.c extracted from sol-thread.c


> gdb/ChangeLog:
> 
>         * sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
>         Move these functions to sol-sparc-thread.c.
>         * sol-sparc-thread.c: New file.
>         * configure.ac: Add sol-sparc-thread.o to CONFIG_OBS and
>         sol-sparc-thread.c to CONFIG_SRCS for sparc-solaris native
>         configurations.
>         * configure: Regenerate.

Here is the patch that I checked in. It only renamed sol-sparc-thread.c
into sparc-sol-thread.c.

-- 
Joel
>From 331eba3bb8038a13df707e5bd4194f1e4f178688 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Thu, 20 Sep 2012 18:17:22 -0400
Subject: [PATCH 1/2] New unit sparc-sol-thread.c extracted from sol-thread.c

Moving some sparc-specific routines out of sol-thread.c into their
own (new) file.

gdb/ChangeLog:

        * sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
        Move these functions to sparc-sol-thread.c.
        * sparc-sol-thread.c: New file.
        * configure.ac: Add sparc-sol-thread.o to CONFIG_OBS and
        sparc-sol-thread.c to CONFIG_SRCS for sparc-solaris native
        configurations.
        * configure: Regenerate.
---
 gdb/ChangeLog          |   10 ++++++++++
 gdb/configure          |    7 +++++++
 gdb/configure.ac       |    7 +++++++
 gdb/sol-thread.c       |   28 ----------------------------
 gdb/sparc-sol-thread.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 67 insertions(+), 28 deletions(-)
 create mode 100644 gdb/sparc-sol-thread.c

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fe6bc60..aba3e0f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,16 @@
 2012-09-27  Joel Brobecker  <brobecker@adacore.com>
 
 	* sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
+	Move these functions to sparc-sol-thread.c.
+	* sparc-sol-thread.c: New file.
+	* configure.ac: Add sparc-sol-thread.o to CONFIG_OBS and
+	sparc-sol-thread.c to CONFIG_SRCS for sparc-solaris native
+	configurations.
+	* configure: Regenerate.
+
+2012-09-27  Joel Brobecker  <brobecker@adacore.com>
+
+	* sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
 	Remove commented-out code.
 
 2012-09-27  Joel Brobecker  <brobecker@adacore.com>
diff --git a/gdb/configure b/gdb/configure
index f1a8f0f..d913de6 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -11969,6 +11969,13 @@ $as_echo "#define HAVE_THREAD_DB_LIB 1" >>confdefs.h
 
          CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
          CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
+         # On SPARC CPUs, we also need to build sparc-sol-thread.
+         case ${host_cpu} in
+           sparc*)
+             CONFIG_OBS="${CONFIG_OBS} sparc-sol-thread.o"
+             CONFIG_SRCS="${CONFIG_SRCS} sparc-sol-thread.c"
+             ;;
+         esac
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0c62b46..c0fd0e1 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1719,6 +1719,13 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
          [Define if using Solaris thread debugging.])
          CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
          CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
+         # On SPARC CPUs, we also need to build sparc-sol-thread.
+         case ${host_cpu} in
+           sparc*)
+             CONFIG_OBS="${CONFIG_OBS} sparc-sol-thread.o"
+             CONFIG_SRCS="${CONFIG_SRCS} sparc-sol-thread.c"
+             ;;
+         esac
          AC_CHECK_LIB(dl, dlopen)
 	 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
 	 # Sun randomly tweaked the prototypes in <proc_service.h>
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index d948e9c..585a77f 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -959,34 +959,6 @@ ps_plog (const char *fmt, ...)
   vfprintf_filtered (gdb_stderr, fmt, args);
 }
 
-#if defined (__sparc) || defined (__sparcv9)
-
-/* Get size of extra register set.  Currently a noop.  */
-
-ps_err_e
-ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
-{
-  return PS_OK;
-}
-
-/* Get extra register set.  Currently a noop.  */
-
-ps_err_e
-ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
-{
-  return PS_OK;
-}
-
-/* Set extra register set.  Currently a noop.  */
-
-ps_err_e
-ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
-{
-  return PS_OK;
-}
-
-#endif /* defined (__sparc) || defined (__sparcv9) */
-
 /* Get floating-point registers for LWP.  */
 
 ps_err_e
diff --git a/gdb/sparc-sol-thread.c b/gdb/sparc-sol-thread.c
new file mode 100644
index 0000000..6b7c49d
--- /dev/null
+++ b/gdb/sparc-sol-thread.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "defs.h"
+#include <proc_service.h>
+
+/* Get size of extra register set.  Currently a noop.  */
+
+ps_err_e
+ps_lgetxregsize (struct ps_prochandle *ph, lwpid_t lwpid, int *xregsize)
+{
+  return PS_OK;
+}
+
+/* Get extra register set.  Currently a noop.  */
+
+ps_err_e
+ps_lgetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset)
+{
+  return PS_OK;
+}
+
+/* Set extra register set.  Currently a noop.  */
+
+ps_err_e
+ps_lsetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset)
+{
+  return PS_OK;
+}
-- 
1.7.9.5


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