summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-12-15 20:27:14 +0000
committerMark Kettenis <kettenis@gnu.org>2003-12-15 20:27:14 +0000
commite09ce445e44fa6849c92b37c1b6d9192d69d901d (patch)
tree21b891060d29b45a41bf3953d636d41e7632d1c3
parentbfbb65e8031224d2ab7f356eee6088c832e52260 (diff)
downloadgdb-e09ce445e44fa6849c92b37c1b6d9192d69d901d.tar.gz
* sparc-sol2-nat.c: Add 64-bit support.
(supply_gregset): Call sparc_supply_gregset instead of sparc32_supply_gregset. (supply_fpregset, fill_gregset, fill_fpregset): Likewise. * sparc64-sol2-nat.c: Remove file. * configure.host: Use a single configuration for sparc-*-solaris2*, sparcv9-*-solaris2* and sparc64-solaris2*. * Makefile.in (ALLDEPFILES): Remobe sparc64-sol2-nat.c. (sparc-sol2-nat.o): Update dependency. (sparc64-sol2-nat.o): Remove dependency. * config/sparc/sol2.mh: Update comment. * config/sparc/sol64.mh: Remobe file.
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/config/sparc/sol2.mh2
-rw-r--r--gdb/config/sparc/sol64.mh6
-rw-r--r--gdb/configure.host5
-rw-r--r--gdb/sparc-sol2-nat.c49
-rw-r--r--gdb/sparc64-sol2-nat.c57
6 files changed, 60 insertions, 74 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97181aeaf18..6b97f5dc26f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2003-12-15 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-sol2-nat.c: Add 64-bit support.
+ (supply_gregset): Call sparc_supply_gregset
+ instead of sparc32_supply_gregset.
+ (supply_fpregset, fill_gregset, fill_fpregset): Likewise.
+ * sparc64-sol2-nat.c: Remove file.
+ * configure.host: Use a single configuration for
+ sparc-*-solaris2*, sparcv9-*-solaris2* and sparc64-solaris2*.
+ * Makefile.in (ALLDEPFILES): Remobe sparc64-sol2-nat.c.
+ (sparc-sol2-nat.o): Update dependency.
+ (sparc64-sol2-nat.o): Remove dependency.
+ * config/sparc/sol2.mh: Update comment.
+ * config/sparc/sol64.mh: Remobe file.
+
2003-12-14 Mark Kettenis <kettenis@gnu.org>
* configure.tgt: Rearrange things such that we include 64-bit
diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
index 04ce8f9f39c..735b9ee8096 100644
--- a/gdb/config/sparc/sol2.mh
+++ b/gdb/config/sparc/sol2.mh
@@ -1,4 +1,4 @@
-# Host: Solaris SPARC
+# Host: Solaris SPARC & UltraSPARC
NAT_FILE= nm-sol2.h
NATDEPFILES= sparc-sol2-nat.o \
corelow.o core-regset.o fork-child.o gcore.o \
diff --git a/gdb/config/sparc/sol64.mh b/gdb/config/sparc/sol64.mh
deleted file mode 100644
index da5c0b4b62b..00000000000
--- a/gdb/config/sparc/sol64.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Solaris UltraSPARC
-NAT_FILE= nm-sol2.h
-NATDEPFILES= sparc64-sol2-nat.o \
- corelow.o core-regset.o fork-child.o gcore.o \
- procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o \
- solib.o solib-svr4.o solib-legacy.o
diff --git a/gdb/configure.host b/gdb/configure.host
index 3779635f55b..a828c272ed2 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -134,11 +134,10 @@ sparc-*-linux*) gdb_host=linux ;;
sparc-*-netbsdelf*) gdb_host=nbsdelf ;;
sparc-*-netbsdaout*) gdb_host_nbsdaout ;;
sparc-*-netbsd*) gdb_host=nbsdaout ;;
-sparc-*-solaris2*) gdb_host=sol2 ;;
sparc64-*-freebsd*) gdb_host=fbsd ;;
sparc64-*-linux*) gdb_host=linux64 ;;
-sparc64-*-solaris2* | sparcv9-*-solaris2*)
- gdb_host=sol64
+sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
+ gdb_host=sol2
;;
vax-*-bsd*) gdb_host=vaxbsd ;;
diff --git a/gdb/sparc-sol2-nat.c b/gdb/sparc-sol2-nat.c
index e42e3c84b18..8d11bc6afc7 100644
--- a/gdb/sparc-sol2-nat.c
+++ b/gdb/sparc-sol2-nat.c
@@ -27,31 +27,66 @@
#include "sparc-tdep.h"
-/* These functions provide the (temporary) glue between the Solaris
- SPARC target dependent code and the machine independent SVR4 /proc
+/* This file provids the (temporary) glue between the Solaris SPARC
+ target dependent code and the machine independent SVR4 /proc
support. */
+/* Solaris 7 (Solaris 2.7, SunOS 5.7) and up support two process data
+ models, the traditional 32-bit data model (ILP32) and the 64-bit
+ data model (LP64). The format of /proc depends on the data model
+ of the observer (the controlling process, GDB in our case). The
+ Solaris header files conveniently define PR_MODEL_NATIVE to the
+ data model of the controlling process. If its value is
+ PR_MODEL_LP64, we know that GDB is being compiled as a 64-bit
+ program.
+
+ Note that a 32-bit GDB won't be able to debug a 64-bit target
+ process using /proc. */
+
+#if defined (PR_MODEL_NATIVE) && (PR_MODEL_NATIVE == PR_MODEL_LP64)
+
+#include "sparc64-tdep.h"
+
+#define sparc_supply_gregset sparc64_supply_gregset
+#define sparc_supply_fpregset sparc64_supply_fpregset
+#define sparc_collect_gregset sparc64_collect_gregset
+#define sparc_collect_fpregset sparc64_collect_fpregset
+
+#define sparc_sol2_gregset sparc64_sol2_gregset
+#define sparc_sol2_fpregset sparc64_sol2_fpregset
+
+#else
+
+#define sparc_supply_gregset sparc32_supply_gregset
+#define sparc_supply_fpregset sparc32_supply_fpregset
+#define sparc_collect_gregset sparc32_collect_gregset
+#define sparc_collect_fpregset sparc32_collect_fpregset
+
+#define sparc_sol2_gregset sparc32_sol2_gregset
+#define sparc_sol2_fpregset sparc32_sol2_fpregset
+
+#endif
+
void
supply_gregset (prgregset_t *gregs)
{
- sparc32_supply_gregset (&sparc32_sol2_gregset, current_regcache, -1, gregs);
+ sparc_supply_gregset (&sparc_sol2_gregset, current_regcache, -1, gregs);
}
void
supply_fpregset (prfpregset_t *fpregs)
{
- sparc32_supply_fpregset (current_regcache, -1, fpregs);
+ sparc_supply_fpregset (current_regcache, -1, fpregs);
}
void
fill_gregset (prgregset_t *gregs, int regnum)
{
- sparc32_collect_gregset (&sparc32_sol2_gregset,
- current_regcache, regnum, gregs);
+ sparc_collect_gregset (&sparc_sol2_gregset, current_regcache, regnum, gregs);
}
void
fill_fpregset (prfpregset_t *fpregs, int regnum)
{
- sparc32_collect_fpregset (current_regcache, regnum, fpregs);
+ sparc_collect_fpregset (current_regcache, regnum, fpregs);
}
diff --git a/gdb/sparc64-sol2-nat.c b/gdb/sparc64-sol2-nat.c
deleted file mode 100644
index 2af009df57f..00000000000
--- a/gdb/sparc64-sol2-nat.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Native-dependent code for Solaris UltraSPARC.
-
- Copyright 2003 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 2 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, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "regcache.h"
-
-#include <sys/procfs.h>
-#include "gregset.h"
-
-#include "sparc64-tdep.h"
-
-/* These functions provide the (temporary) glue between the Solaris
- SPARC target dependent code and the machine independent SVR4 /proc
- support. */
-
-void
-supply_gregset (prgregset_t *gregs)
-{
- sparc64_supply_gregset (&sparc64_sol2_gregset, current_regcache, -1, gregs);
-}
-
-void
-supply_fpregset (prfpregset_t *fpregs)
-{
- sparc64_supply_fpregset (current_regcache, -1, fpregs);
-}
-
-void
-fill_gregset (prgregset_t *gregs, int regnum)
-{
- sparc64_collect_gregset (&sparc64_sol2_gregset,
- current_regcache, regnum, gregs);
-}
-
-void
-fill_fpregset (prfpregset_t *fpregs, int regnum)
-{
- sparc64_collect_fpregset (current_regcache, regnum, fpregs);
-}