This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix two xfer partial bugs; Was; RFA: ia64 portion of libunwindpatch
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: "J. Johnston" <jjohnstn at redhat dot com>
- Cc: Andrew Cagney <ac131313 at redhat dot com>,Daniel Jacobowitz <drow at mvista dot com>,Kevin Buettner <kevinb at redhat dot com>,Marcel Moolenaar <marcel at xcllnt dot net>, gdb-patches at sources dot redhat dot com
- Date: Thu, 06 Nov 2003 15:03:25 -0500
- Subject: [commit] Fix two xfer partial bugs; Was; RFA: ia64 portion of libunwindpatch
- References: <3F986E31.8050201@redhat.com> <1031024175718.ZM3475@localhost.localdomain> <3F996D88.9060505@redhat.com> <1031024185625.ZM9827@localhost.localdomain> <3F9F0180.2010702@redhat.com> <20031029012833.GA11070@nevyn.them.org> <3FA043B2.6090401@redhat.com> <3FA7F97B.4090909@redhat.com>
Jeff,
I've just committed the attached. It fixes two bugs when using xfer
partial in an existing target.
- the "add_target" method was always overriding the child's
to_xfer_partial method. The consequence is that the code your patch
adds is never called!
- the code would all off the end of a stack which this part of the
change fixed: * target.c (init_dummy_target): Initialize to_xfer_partial
to default.
I've one more tweak to the target code. Once thats in can you please
confirm that this new child method is called and is needed - seems
things work without it?
Andrew
2003-11-06 Andrew Cagney <cagney@redhat.com>
Jeff Johnston <jjohnstn@redhat.com>
* target.c (add_target): Only set "to_xfer_partial" when NULL.
(init_dummy_target): Set "to_xfer_partial".
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.64
diff -u -r1.64 target.c
--- target.c 31 Oct 2003 15:25:34 -0000 1.64
+++ target.c 6 Nov 2003 19:55:45 -0000
@@ -220,7 +220,8 @@
add_target (struct target_ops *t)
{
/* Provide default values for all "must have" methods. */
- t->to_xfer_partial = default_xfer_partial;
+ if (t->to_xfer_partial == NULL)
+ t->to_xfer_partial = default_xfer_partial;
if (!target_structs)
{
@@ -1644,6 +1645,7 @@
dummy_target.to_stratum = dummy_stratum;
dummy_target.to_find_memory_regions = dummy_find_memory_regions;
dummy_target.to_make_corefile_notes = dummy_make_corefile_notes;
+ dummy_target.to_xfer_partial = default_xfer_partial;
dummy_target.to_magic = OPS_MAGIC;
}