public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  tromey/multi-target: fix allocate_record_full_gdb_target to init ops
@ 2013-08-29 16:08 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2013-08-29 16:08 UTC (permalink / raw)
  To: archer-commits

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 <tromey@redhat.com>
Date:   Thu Aug 29 10:07:53 2013 -0600

    fix allocate_record_full_gdb_target to init ops

commit b33166ddb6c19ecc519a55797260585da305038c
Author: Tom Tromey <tromey@redhat.com>
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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-29 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-29 16:08 [SCM] tromey/multi-target: fix allocate_record_full_gdb_target to init ops tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).