Fix PR gdb/20948: --write option to GDB causes segmentation fault
[deliverable/binutils-gdb.git] / gdb / sparc-tdep.c
index 65c1f00620486bb8c7ce190f8381346cf311d9c6..7a50a8d4a97dd15e8ed0515ad03422c19edd9e01 100644 (file)
@@ -189,7 +189,7 @@ ULONGEST
 sparc_fetch_wcookie (struct gdbarch *gdbarch)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  struct target_ops *ops = target_stack;
+  struct target_ops *ops = current_top_target ();
   gdb_byte buf[8];
   int len;
 
@@ -1777,8 +1777,10 @@ sparc_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, tdep->gregset, NULL, cb_data);
-  cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, tdep->gregset, NULL,
+      cb_data);
+  cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset,
+      NULL, cb_data);
 }
 \f
 
This page took 0.02456 seconds and 4 git commands to generate.