aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-03-12 20:00:21 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-03-12 20:00:21 +0000
commit965b60eecbf5def589aea7c6359dcf48fdadce26 (patch)
tree78589e53e12c767dd6a122408ae5fb53ec183479 /gdb/procfs.c
parent83116857a35fc5125d098984fae29a549a2b29f3 (diff)
downloadfsf-binutils-gdb-965b60eecbf5def589aea7c6359dcf48fdadce26.zip
fsf-binutils-gdb-965b60eecbf5def589aea7c6359dcf48fdadce26.tar.gz
fsf-binutils-gdb-965b60eecbf5def589aea7c6359dcf48fdadce26.tar.bz2
* sol-thread.c: Replace use of TM_I386SOL2_H by an expression
that is true only on x86-solaris and x86_64-solaris. * procfs.c: Likewise. Move procfs_find_LDT_entry up together with proc_get_LDT_entry.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c82
1 files changed, 40 insertions, 42 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index bde710a..72d72cc 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2919,7 +2919,7 @@ proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
#endif
}
-#ifdef TM_I386SOL2_H /* Is it hokey to use this? */
+#if (defined(__i386__) || defined(__x86_64__)) && defined (sun)
#include <sys/sysi86.h>
@@ -3011,7 +3011,45 @@ proc_get_LDT_entry (procinfo *pi, int key)
#endif
}
-#endif /* TM_I386SOL2_H */
+/*
+ * Function: procfs_find_LDT_entry
+ *
+ * Input:
+ * ptid_t ptid; // The GDB-style pid-plus-LWP.
+ *
+ * Return:
+ * pointer to the corresponding LDT entry.
+ */
+
+struct ssd *
+procfs_find_LDT_entry (ptid_t ptid)
+{
+ gdb_gregset_t *gregs;
+ int key;
+ procinfo *pi;
+
+ /* Find procinfo for the lwp. */
+ if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
+ {
+ warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%d."),
+ PIDGET (ptid), TIDGET (ptid));
+ return NULL;
+ }
+ /* get its general registers. */
+ if ((gregs = proc_get_gregs (pi)) == NULL)
+ {
+ warning (_("procfs_find_LDT_entry: could not read gregs for %d:%d."),
+ PIDGET (ptid), TIDGET (ptid));
+ return NULL;
+ }
+ /* Now extract the GS register's lower 16 bits. */
+ key = (*gregs)[GS] & 0xffff;
+
+ /* Find the matching entry and return it. */
+ return proc_get_LDT_entry (pi, key);
+}
+
+#endif
/* =============== END, non-thread part of /proc "MODULE" =============== */
@@ -5331,46 +5369,6 @@ procfs_stopped_by_watchpoint (ptid_t ptid)
return 0;
}
-#ifdef TM_I386SOL2_H
-/*
- * Function: procfs_find_LDT_entry
- *
- * Input:
- * ptid_t ptid; // The GDB-style pid-plus-LWP.
- *
- * Return:
- * pointer to the corresponding LDT entry.
- */
-
-struct ssd *
-procfs_find_LDT_entry (ptid_t ptid)
-{
- gdb_gregset_t *gregs;
- int key;
- procinfo *pi;
-
- /* Find procinfo for the lwp. */
- if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
- {
- warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%d."),
- PIDGET (ptid), TIDGET (ptid));
- return NULL;
- }
- /* get its general registers. */
- if ((gregs = proc_get_gregs (pi)) == NULL)
- {
- warning (_("procfs_find_LDT_entry: could not read gregs for %d:%d."),
- PIDGET (ptid), TIDGET (ptid));
- return NULL;
- }
- /* Now extract the GS register's lower 16 bits. */
- key = (*gregs)[GS] & 0xffff;
-
- /* Find the matching entry and return it. */
- return proc_get_LDT_entry (pi, key);
-}
-#endif /* TM_I386SOL2_H */
-
/*
* Memory Mappings Functions:
*/