aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-06-13 18:50:38 +0000
committerDaniel Jacobowitz <drow@false.org>2007-06-13 18:50:38 +0000
commit117ce5436248fc716d7328850061120ba2e05bbf (patch)
treeaae0d3e7d90fc2ac6f0fe07749ed43d6c463d019 /gdb/gdbserver
parent822b65708d4030ccb4fd2a979de5292f730e30b8 (diff)
downloadgdb-117ce5436248fc716d7328850061120ba2e05bbf.zip
gdb-117ce5436248fc716d7328850061120ba2e05bbf.tar.gz
gdb-117ce5436248fc716d7328850061120ba2e05bbf.tar.bz2
* features/Makefile: Generate regformats for mips-linux and
mips64-linux. * features/sort-regs.xsl: Correct typo. * regformats/reg-mips.dat, regformats/reg-mips64.dat: Delete. * regformats/mips-linux.dat, regformats/mips64-linux.dat: New generated files. * Makefile.in (clean): Clean new files instead of deleted ones. (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete. (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New rules. * configure.srv: Specify XML files and new regformats for MIPS and MIPS64 GNU/Linux. * linux-mips-low.c (mips_num_regs): Set to only used registers. (mips_regmap): Do not fetch $0. Remove unused registers. Add an entry for the restart register. (mips_cannot_fetch_register, mips_cannot_store_register) (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update register names to match the XML descriptions. (mips_fill_gregset, mips_store_gregset): Likewise. Handle the restart register instead of $0.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog17
-rw-r--r--gdb/gdbserver/Makefile.in18
-rw-r--r--gdb/gdbserver/configure.srv8
-rw-r--r--gdb/gdbserver/linux-mips-low.c35
4 files changed, 50 insertions, 28 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 994fe8d..17efed1 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,20 @@
+2007-06-13 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * Makefile.in (clean): Clean new files instead of deleted ones.
+ (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
+ (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
+ rules.
+ * configure.srv: Specify XML files and new regformats for MIPS and
+ MIPS64 GNU/Linux.
+ * linux-mips-low.c (mips_num_regs): Set to only used registers.
+ (mips_regmap): Do not fetch $0. Remove unused registers. Add
+ an entry for the restart register.
+ (mips_cannot_fetch_register, mips_cannot_store_register)
+ (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
+ register names to match the XML descriptions.
+ (mips_fill_gregset, mips_store_gregset): Likewise. Handle the
+ restart register instead of $0.
+
2007-06-12 Ulrich Weigand <uweigand@de.ibm.com>
Markus Deuling <deuling@de.ibm.com>
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index fad7963..4ebf508 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -215,10 +215,10 @@ clean:
rm -f *.o ${ADD_FILES} *~
rm -f version.c
rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
- rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c reg-mips.c
+ rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c
rm -f reg-ppc.c reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c
- rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-mips64.c
- rm -f arm-with-iwmmxt.c
+ rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c
+ rm -f arm-with-iwmmxt.c mips-linux.c mips64-linux.c
rm -f xml-builtin.c stamp-xml target.xml
maintainer-clean realclean distclean: clean
@@ -344,12 +344,12 @@ reg-m32r.c : $(srcdir)/../regformats/reg-m32r.dat $(regdat_sh)
reg-m68k.o : reg-m68k.c $(regdef_h)
reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
sh $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
-reg-mips.o : reg-mips.c $(regdef_h)
-reg-mips.c : $(srcdir)/../regformats/reg-mips.dat $(regdat_sh)
- sh $(regdat_sh) $(srcdir)/../regformats/reg-mips.dat reg-mips.c
-reg-mips64.o : reg-mips64.c $(regdef_h)
-reg-mips64.c : $(srcdir)/../regformats/reg-mips64.dat $(regdat_sh)
- sh $(regdat_sh) $(srcdir)/../regformats/reg-mips64.dat reg-mips64.c
+mips-linux.o : mips-linux.c $(regdef_h)
+mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/mips-linux.dat mips-linux.c
+mips64-linux.o : mips64-linux.c $(regdef_h)
+mips64-linux.c : $(srcdir)/../regformats/mips64-linux.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/mips64-linux.dat mips64-linux.c
reg-ppc.o : reg-ppc.c $(regdef_h)
reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh)
sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 8f39e90..ff14adc 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -83,13 +83,17 @@ case "${target}" in
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
- mips*64*-*-linux*) srv_regobj=reg-mips64.o
+ mips*64*-*-linux*) srv_regobj=mips64-linux.o
+ srv_xmltarget=mips64-linux.xml
+ srv_xmlfiles="mips64-cpu.xml mips64-cp0.xml mips64-fpu.xml"
srv_tgtobj="linux-low.o linux-mips-low.o"
srv_linux_regsets=yes
srv_linux_usrregs=yes
srv_linux_thread_db=yes
;;
- mips*-*-linux*) srv_regobj=reg-mips.o
+ mips*-*-linux*) srv_regobj=mips-linux.o
+ srv_xmltarget=mips-linux.xml
+ srv_xmlfiles="mips-cpu.xml mips-cp0.xml mips-fpu.xml"
srv_tgtobj="linux-low.o linux-mips-low.o"
srv_linux_regsets=yes
srv_linux_usrregs=yes
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 2921b28..615f8d7 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -35,7 +35,7 @@
#include <sys/reg.h>
#endif
-#define mips_num_regs 90
+#define mips_num_regs 73
#include <asm/ptrace.h>
@@ -50,9 +50,8 @@ union mips_register
/* Return the ptrace ``address'' of register REGNO. */
-/* Matches mips_generic32_regs */
static int mips_regmap[] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
+ -1, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
@@ -69,9 +68,7 @@ static int mips_regmap[] = {
FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31,
FPC_CSR, FPC_EIR,
- -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
+ 0
};
/* From mips-linux-nat.c. */
@@ -87,7 +84,7 @@ mips_cannot_fetch_register (int regno)
if (mips_regmap[regno] == -1)
return 1;
- if (find_regno ("zero") == regno)
+ if (find_regno ("r0") == regno)
return 1;
return 0;
@@ -99,13 +96,13 @@ mips_cannot_store_register (int regno)
if (mips_regmap[regno] == -1)
return 1;
- if (find_regno ("zero") == regno)
+ if (find_regno ("r0") == regno)
return 1;
if (find_regno ("cause") == regno)
return 1;
- if (find_regno ("bad") == regno)
+ if (find_regno ("badvaddr") == regno)
return 1;
if (find_regno ("fir") == regno)
@@ -145,7 +142,7 @@ static CORE_ADDR
mips_reinsert_addr ()
{
union mips_register ra;
- collect_register_by_name ("ra", ra.buf);
+ collect_register_by_name ("r31", ra.buf);
return register_size (0) == 4 ? ra.reg32 : ra.reg64;
}
@@ -242,15 +239,17 @@ mips_fill_gregset (void *buf)
use_64bit = (register_size (0) == 8);
- for (i = 0; i < 32; i++)
+ for (i = 1; i < 32; i++)
mips_collect_register (use_64bit, i, regset + i);
mips_collect_register (use_64bit, find_regno ("lo"), regset + 32);
mips_collect_register (use_64bit, find_regno ("hi"), regset + 33);
mips_collect_register (use_64bit, find_regno ("pc"), regset + 34);
- mips_collect_register (use_64bit, find_regno ("bad"), regset + 35);
- mips_collect_register (use_64bit, find_regno ("sr"), regset + 36);
+ mips_collect_register (use_64bit, find_regno ("badvaddr"), regset + 35);
+ mips_collect_register (use_64bit, find_regno ("status"), regset + 36);
mips_collect_register (use_64bit, find_regno ("cause"), regset + 37);
+
+ mips_collect_register (use_64bit, find_regno ("restart"), regset + 0);
}
static void
@@ -267,9 +266,11 @@ mips_store_gregset (const void *buf)
mips_supply_register (use_64bit, find_regno ("lo"), regset + 32);
mips_supply_register (use_64bit, find_regno ("hi"), regset + 33);
mips_supply_register (use_64bit, find_regno ("pc"), regset + 34);
- mips_supply_register (use_64bit, find_regno ("bad"), regset + 35);
- mips_supply_register (use_64bit, find_regno ("sr"), regset + 36);
+ mips_supply_register (use_64bit, find_regno ("badvaddr"), regset + 35);
+ mips_supply_register (use_64bit, find_regno ("status"), regset + 36);
mips_supply_register (use_64bit, find_regno ("cause"), regset + 37);
+
+ mips_supply_register (use_64bit, find_regno ("restart"), regset + 0);
}
static void
@@ -290,7 +291,7 @@ mips_fill_fpregset (void *buf)
collect_register (first_fp + i,
regset[i & ~1].buf + 4 * (big_endian != (i & 1)));
- mips_collect_register_32bit (use_64bit, find_regno ("fsr"), regset[32].buf);
+ mips_collect_register_32bit (use_64bit, find_regno ("fcsr"), regset[32].buf);
mips_collect_register_32bit (use_64bit, find_regno ("fir"),
regset[32].buf + 4);
}
@@ -313,7 +314,7 @@ mips_store_fpregset (const void *buf)
supply_register (first_fp + i,
regset[i & ~1].buf + 4 * (big_endian != (i & 1)));
- mips_supply_register_32bit (use_64bit, find_regno ("fsr"), regset[32].buf);
+ mips_supply_register_32bit (use_64bit, find_regno ("fcsr"), regset[32].buf);
mips_supply_register_32bit (use_64bit, find_regno ("fir"),
regset[32].buf + 4);
}