Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/gdb/gdb In the thread support functions only transf...



details:   https://anonhg.NetBSD.org/src/rev/5c08c96aa18c
branches:  trunk
changeset: 552659:5c08c96aa18c
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Sep 29 17:47:26 2003 +0000

description:
In the thread support functions only transfer those registers, that fit
into our struct fpreg64. This avoids gdb crashing due to smashed stack
when debugging threaded programs.

diffstat:

 gnu/dist/gdb/gdb/sparc64nbsd-nat.c |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r ce4a50110592 -r 5c08c96aa18c gnu/dist/gdb/gdb/sparc64nbsd-nat.c
--- a/gnu/dist/gdb/gdb/sparc64nbsd-nat.c        Mon Sep 29 15:12:08 2003 +0000
+++ b/gnu/dist/gdb/gdb/sparc64nbsd-nat.c        Mon Sep 29 17:47:26 2003 +0000
@@ -220,10 +220,15 @@
 nbsd_fpreg_to_internal (frgs)
        char *frgs;
 {
+  int i;
+
   if (gdbarch_ptr_bit (current_gdbarch) == 32)
     sparcnbsd_supply_fpreg32(frgs, -1);
-  else
-    sparcnbsd_supply_fpreg64(frgs, -1);
+  else {
+    for (i = 0; i < 32; i++)
+      sparcnbsd_supply_fpreg64(frgs + i*8, FP0_REGNUM+i);
+    sparcnbsd_supply_fpreg64(frgs + 32*8, FSR_REGNUM);
+  }
 }
 
 void
@@ -232,7 +237,7 @@
 {
   if (gdbarch_ptr_bit (current_gdbarch) == 32)
     sparcnbsd_fill_reg32(regs, -1);
-  else
+  else 
     sparcnbsd_fill_reg64(regs, -1);
 }
 
@@ -240,9 +245,14 @@
 nbsd_internal_to_fpreg (fpregs)
        char *fpregs;
 {
+  int i;
+
   if (gdbarch_ptr_bit (current_gdbarch) == 32)
     sparcnbsd_fill_fpreg32(fpregs, -1);
-  else
-    sparcnbsd_fill_fpreg64(fpregs, -1);
+  else {
+    for (i = 0; i < 32; i++)
+      sparcnbsd_fill_fpreg64(fpregs + i*8, FP0_REGNUM+i);
+    sparcnbsd_fill_fpreg64(fpregs + 32*8, FSR_REGNUM);
+  }
 }
 



Home | Main Index | Thread Index | Old Index