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 put back the kvm stuff lost in pr...



details:   https://anonhg.NetBSD.org/src/rev/6eb83c53b9a0
branches:  trunk
changeset: 457693:6eb83c53b9a0
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 12 22:43:15 2019 +0000

description:
put back the kvm stuff lost in previous merge.

diffstat:

 external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c |  46 +++++++++++++++++++++++------
 1 files changed, 36 insertions(+), 10 deletions(-)

diffs (65 lines):

diff -r 3a7221b4849a -r 6eb83c53b9a0 external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c        Fri Jul 12 22:42:45 2019 +0000
+++ b/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c        Fri Jul 12 22:43:15 2019 +0000
@@ -28,16 +28,6 @@
 #include <sys/ptrace.h>
 #include <machine/reg.h>
 
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
-
 #include "mips-tdep.h"
 #include "nbsd-nat.h"
 #include "mips-nbsd-tdep.h"
@@ -133,8 +123,44 @@
     }
 }
 
+static int
+mipsnbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct label_t sf;
+
+  sf = pcb->pcb_context;
+
+  /* really should test for n{32,64} abi for this register
+     unless this is purely the "n" ABI */
+
+  regcache->raw_supply (MIPS_S0_REGNUM, &sf.val[_L_S0]);
+  regcache->raw_supply (MIPS_S1_REGNUM, &sf.val[_L_S1]);
+  regcache->raw_supply (MIPS_S2_REGNUM, &sf.val[_L_S2]);
+  regcache->raw_supply (MIPS_S3_REGNUM, &sf.val[_L_S3]);
+  regcache->raw_supply (MIPS_S4_REGNUM, &sf.val[_L_S4]);
+  regcache->raw_supply (MIPS_S5_REGNUM, &sf.val[_L_S5]);
+  regcache->raw_supply (MIPS_S6_REGNUM, &sf.val[_L_S6]);
+  regcache->raw_supply (MIPS_S7_REGNUM, &sf.val[_L_S7]);
+
+  regcache->raw_supply (MIPS_S8_REGNUM, &sf.val[_L_S8]);
+
+  regcache->raw_supply (MIPS_T8_REGNUM, &sf.val[_L_T8]);
+
+  regcache->raw_supply (MIPS_GP_REGNUM, &sf.val[_L_GP]);
+
+  regcache->raw_supply (MIPS_SP_REGNUM, &sf.val[_L_SP]);
+  regcache->raw_supply (MIPS_RA_REGNUM, &sf.val[_L_RA]);
+  regcache->raw_supply (MIPS_PS_REGNUM, &sf.val[_L_SR]);
+
+  /* provide the return address of the savectx as the current pc */
+  regcache->raw_supply (MIPS_EMBED_PC_REGNUM, &sf.val[_L_RA]);
+
+  return 0;
+}
+
 void
 _initialize_mipsnbsd_nat (void)
 {
   add_inf_child_target (&the_mips_nbsd_nat_target);
+  bsd_kvm_add_target (mipsnbsd_supply_pcb);
 }



Home | Main Index | Thread Index | Old Index