From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16202 invoked by alias); 29 Aug 2013 16:08:02 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 16128 invoked by uid 306); 29 Aug 2013 16:08:01 -0000 Date: Thu, 29 Aug 2013 16:08:00 -0000 Message-ID: <20130829160801.16097.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] tromey/multi-target: fix allocate_record_full_gdb_target to init ops X-Git-Refname: refs/heads/tromey/multi-target X-Git-Reftype: branch X-Git-Oldrev: 3b8660606cc0531808389d18e6cffcaa1544c27d X-Git-Newrev: ce573a1468d45e6d1f167ed5d1fb9deb53bf351d X-SW-Source: 2013-q3/txt/msg00030.txt.bz2 List-Id: The branch, tromey/multi-target has been updated via ce573a1468d45e6d1f167ed5d1fb9deb53bf351d (commit) via b33166ddb6c19ecc519a55797260585da305038c (commit) from 3b8660606cc0531808389d18e6cffcaa1544c27d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit ce573a1468d45e6d1f167ed5d1fb9deb53bf351d Author: Tom Tromey Date: Thu Aug 29 10:07:53 2013 -0600 fix allocate_record_full_gdb_target to init ops commit b33166ddb6c19ecc519a55797260585da305038c Author: Tom Tromey Date: Thu Aug 29 09:46:23 2013 -0600 make push_gdb_target respect target_close invariant ----------------------------------------------------------------------- Summary of changes: gdb/record-full.c | 7 ++++--- gdb/target.c | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) First 500 lines of diff: diff --git a/gdb/record-full.c b/gdb/record-full.c index cc94135..9a093cf 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -827,12 +827,13 @@ record_full_async_inferior_event_handler (gdb_client_data data) } static struct record_full_gdb_target * -allocate_record_full_gdb_target (void) +allocate_record_full_gdb_target (struct target_ops *ops) { struct record_full_gdb_target *self; self = XCNEW (struct record_full_gdb_target); + self->base.ops = ops; self->record_full_first.type = record_full_end; self->record_full_list = &self->record_full_first; self->record_full_execution_dir = EXEC_FORWARD; @@ -850,7 +851,7 @@ record_full_core_open_1 (char *name, int from_tty) int i; struct record_full_gdb_target *self; - self = allocate_record_full_gdb_target (); + self = allocate_record_full_gdb_target (&record_full_core_ops); /* Get record_full_core_regbuf. */ target_fetch_registers (regcache, -1); @@ -897,7 +898,7 @@ record_full_open_1 (char *name, int from_tty) error (_("Process record: the current architecture doesn't support " "record function.")); - self = allocate_record_full_gdb_target (); + self = allocate_record_full_gdb_target (&record_full_ops); push_gdb_target (&self->base); return self; diff --git a/gdb/target.c b/gdb/target.c index d476fe7..024f0dc 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1079,7 +1079,12 @@ push_gdb_target (struct gdb_target *t) /* FIXME: cagney/2003-10-15: I think this should be popping all targets to CUR, and not just those at this stratum level. */ if (target_stack->ops[t->ops->to_stratum] != NULL) - target_close (target_stack->ops[t->ops->to_stratum]); + { + struct gdb_target *old = target_stack->ops[t->ops->to_stratum]; + + target_stack->ops[t->ops->to_stratum] = NULL; + target_close (old); + } /* We have removed all targets in our stratum, now add the new one. */ target_stack->ops[t->ops->to_stratum] = t; hooks/post-receive -- Repository for Project Archer.