This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Fix OpenBSD/sparc stackghost handling
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Nov 2004 09:43:00 +0100 (CET)
- Subject: [COMMIT] Fix OpenBSD/sparc stackghost handling
I broke it when I converted things to use target vector inheritance.
This patch fixes it. I'll cleanup the mess in config/sparc/nm-nbsd.h
later.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* sparc-nat.c (inf_ptrace_xfer_partial): New variable.
(sparc_xfer_partial): New function.
(sparc_target): Save value of to_xfer_partial from ptrace vector.
Set to_xfer_partial.
Index: sparc-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-nat.c,v
retrieving revision 1.28
diff -u -p -r1.28 sparc-nat.c
--- sparc-nat.c 12 Oct 2004 22:18:54 -0000 1.28
+++ sparc-nat.c 29 Nov 2004 08:40:37 -0000
@@ -305,6 +305,23 @@ sparc_xfer_wcookie (struct target_ops *o
memcpy (readbuf, buf + offset, len);
return len;
}
+
+LONGEST (*inf_ptrace_xfer_partial) (struct target_ops *, enum target_object,
+ const char *, void *, const void *,
+ ULONGEST, LONGEST);
+
+static LONGEST
+sparc_xfer_partial (struct target_ops *ops, enum target_object object,
+ const char *annex, void *readbuf, const void *writebuf,
+ ULONGEST offset, LONGEST len)
+{
+ if (object == TARGET_OBJECT_WCOOKIE)
+ return sparc_xfer_wcookie (ops, object, annex, readbuf, writebuf,
+ offset, len);
+
+ return inf_ptrace_xfer_partial (ops, object, annex, readbuf, writebuf,
+ offset, len);
+}
/* Create a prototype generic SPARC target. The client can override
it with local methods. */
@@ -317,6 +334,8 @@ sparc_target (void)
t = inf_ptrace_target ();
t->to_fetch_registers = fetch_inferior_registers;
t->to_store_registers = store_inferior_registers;
+ inf_ptrace_xfer_partial = t->to_xfer_partial;
+ t->to_xfer_partial = sparc_xfer_partial;
return t;
}