Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gdb/dist/gdb Deal with sh3 having no FPREGS an...
details: https://anonhg.NetBSD.org/src/rev/f6e18471dfbb
branches: trunk
changeset: 773038:f6e18471dfbb
user: christos <christos%NetBSD.org@localhost>
date: Wed Jan 25 16:48:44 2012 +0000
description:
Deal with sh3 having no FPREGS and having 32 bit pointers and 64 bit CORE_ADDR.
Ugly.
diffstat:
external/gpl3/gdb/dist/gdb/nbsd-thread.c | 33 +++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 5 deletions(-)
diffs (144 lines):
diff -r fdf370b95b30 -r f6e18471dfbb external/gpl3/gdb/dist/gdb/nbsd-thread.c
--- a/external/gpl3/gdb/dist/gdb/nbsd-thread.c Wed Jan 25 16:38:27 2012 +0000
+++ b/external/gpl3/gdb/dist/gdb/nbsd-thread.c Wed Jan 25 16:48:44 2012 +0000
@@ -42,6 +42,11 @@
#include "observer.h"
#include <machine/reg.h>
+#ifndef __sh3__
+#define HAVE_FPREGS
+#else
+struct fpreg { };
+#endif
#ifndef HAVE_GREGSET_T
typedef struct reg gregset_t;
@@ -366,7 +371,9 @@
struct target_ops *beneath = find_target_beneath (ops);
td_thread_t *thread;
gregset_t gregs;
+#ifdef HAVE_FPREGS
fpregset_t fpregs;
+#endif
int val;
struct cleanup *old_chain;
@@ -381,8 +388,10 @@
error ("nbsd_thread_fetch_registers: td_thr_getregs: %s\n",
td_err_string (val));
supply_gregset (cache, &gregs);
+#ifdef HAVE_FPREGS
if ((val = td_thr_getregs (thread, 1, &fpregs)) == 0)
supply_fpregset (cache, &fpregs);
+#endif
}
else
{
@@ -404,7 +413,9 @@
struct target_ops *beneath = find_target_beneath (ops);
td_thread_t *thread;
gregset_t gregs;
+#ifdef HAVE_FPREGS
fpregset_t fpregs;
+#endif
int val;
if (nbsd_thread_active && IS_THREAD (inferior_ptid))
@@ -415,16 +426,20 @@
td_err_string (val));
fill_gregset (cache, &gregs, -1);
+#ifdef HAVE_FPREGS
fill_fpregset (cache, &fpregs, -1);
+#endif
val = td_thr_setregs (thread, 0, &gregs);
if (val != 0)
error ("nbsd_thread_store_registers: td_thr_setregs: %s\n",
td_err_string (val));
+#ifdef HAVE_FPREGS
val = td_thr_setregs (thread, 1, &fpregs);
if (val != 0)
error ("nbsd_thread_store_registers: td_thr_setregs: %s\n",
td_err_string (val));
+#endif
}
else
{
@@ -842,7 +857,7 @@
else
return;
- if ((ret = td_map_pth2thr (main_ta, (pthread_t) addr, &th)) != 0)
+ if ((ret = td_map_pth2thr (main_ta, (pthread_t)(uintptr_t)addr, &th)) != 0)
error ("nbsd_thread_examine_command: td_map_pth2thr: %s",
td_err_string (ret));
@@ -949,7 +964,7 @@
printf_filtered ("Key %3d ", key);
/* XXX What does GDB use to print a function? */
- ms = lookup_minimal_symbol_by_pc ((CORE_ADDR)destructor);
+ ms = lookup_minimal_symbol_by_pc ((CORE_ADDR)(uintptr_t)destructor);
if (!ms)
name = "???";
@@ -975,7 +990,7 @@
{
int val;
- val = target_read_memory ((CORE_ADDR)addr, buf, size);
+ val = target_read_memory ((CORE_ADDR)(uintptr_t)addr, buf, size);
if (val == 0)
return 0;
@@ -989,7 +1004,7 @@
{
int val;
- val = target_write_memory ((CORE_ADDR)addr, buf, size);
+ val = target_write_memory ((CORE_ADDR)(uintptr_t)addr, buf, size);
if (val == 0)
return 0;
@@ -1007,7 +1022,7 @@
if (!ms)
return TD_ERR_NOSYM;
- *addr = (caddr_t) SYMBOL_VALUE_ADDRESS (ms);
+ *addr = (caddr_t)(uintptr_t)SYMBOL_VALUE_ADDRESS (ms);
return 0;
@@ -1022,7 +1037,11 @@
*size = sizeof (gregset_t);
break;
case 1:
+#ifdef HAVE_FPREGS
*size = sizeof (fpregset_t);
+#else
+ *size = 0;
+#endif
break;
default:
return TD_ERR_INVAL;
@@ -1066,7 +1085,9 @@
fill_gregset (cache, (gregset_t *)buf, -1);
break;
case 1:
+#ifdef HAVE_FPREGS
fill_fpregset (cache, (fpregset_t *)buf, -1);
+#endif
break;
default: /* XXX need to handle other reg sets: SSE, AltiVec, etc. */
ret = TD_ERR_INVAL;
@@ -1096,7 +1117,9 @@
supply_gregset(cache, (gregset_t *)buf);
break;
case 1:
+#ifdef HAVE_FPREGS
supply_fpregset(cache, (fpregset_t *)buf);
+#endif
break;
default: /* XXX need to handle other reg sets: SSE, AltiVec, etc. */
ret = TD_ERR_INVAL;
Home |
Main Index |
Thread Index |
Old Index