This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore)


Hui Zhu wrote:
On Wed, Oct 21, 2009 at 03:58, Michael Snyder <msnyder@vmware.com> wrote:
Michael Snyder wrote:
Hui Zhu wrote:
On Tue, Oct 20, 2009 at 01:54, Michael Snyder <msnyder@vmware.com> wrote:
Hui Zhu wrote:
Hi Michael,

I think you want unlink the gdb_record when save get some error.  It
maybe need "discard_cleanups" the old_cleanups and bfd_close (obfd);

After change the code, everything is OK.
Yes.  Thanks.  Like this:
+      if (record_list->prev)
+        record_list = record_list->prev;
+    }
+
+  do_cleanups (set_cleanups);
+  bfd_close (obfd);
+  discard_cleanups (old_cleanups);
+
+  /* Succeeded.  */
I suggest:
+  discard_cleanups (old_cleanups);
+  bfd_close (obfd);
The reason I did the bfd_close first is because I wasn't
sure if it was safe to delete the file first.  In any way,
it seems more logical to close the file before delete it.
Oh, oops, never mind. My head's fuzzy today.

Why do you suggest to change the order?
Just curious, I don't have an issue with it...


Sorry I didn't talk the function very clear.


+  bfd_close (obfd);
+  discard_cleanups (old_cleanups);
Before "discard_cleanups (old_cleanups);", the "record_save_cleanups"
will be call sometime.  "record_save_cleanups" will call "bfd_close
(obfd)".
If the record_save_cleanups will happen after "bfd_close (obfd)".
"bfd_close (obfd)" will be call twice.

Of curse, most of time it will not happen. So I just suggest. :)

OK, done and committed.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]