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] let record_resume fail immediately on error


Thanks Joel,

I think stop with sigtrap looks not very well.  So I change it to sigint.

Please help me with it.

Thanks,
Hui

2009-10-15  Hui Zhu  <teawater@gmail.com>

	* record.c (record_resume_error): Deleted.
	(record_resume): Call record_message.
	(record_wait): Deleted record_resume_error.
	Set status when do_record_message need stop the inferior.
---
 record.c |   25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

--- a/record.c
+++ b/record.c
@@ -566,7 +566,6 @@ record_close (int quitting)
 }

 static int record_resume_step = 0;
-static int record_resume_error;

 static void
 record_resume (struct target_ops *ops, ptid_t ptid, int step,
@@ -576,15 +575,11 @@ record_resume (struct target_ops *ops, p

   if (!RECORD_IS_REPLAY)
     {
-      if (do_record_message (get_current_regcache (), signal))
-        {
-          record_resume_error = 0;
-        }
-      else
-        {
-          record_resume_error = 1;
-          return;
-        }
+      struct record_message_args args;
+
+      args.regcache = get_current_regcache ();
+      args.signal = signal;
+      record_message (&args);
       record_beneath_to_resume (record_beneath_to_resume_ops, ptid, 1,
                                 signal);
     }
@@ -636,14 +631,6 @@ record_wait (struct target_ops *ops,

   if (!RECORD_IS_REPLAY)
     {
-      if (record_resume_error)
-	{
-	  /* If record_resume get error, return directly.  */
-	  status->kind = TARGET_WAITKIND_STOPPED;
-	  status->value.sig = TARGET_SIGNAL_ABRT;
-	  return inferior_ptid;
-	}
-
       if (record_resume_step)
 	{
 	  /* This is a single step.  */
@@ -689,6 +676,8 @@ record_wait (struct target_ops *ops,
 		      if (!do_record_message (get_current_regcache (),
 					      TARGET_SIGNAL_0))
 			{
+                          status->kind = TARGET_WAITKIND_STOPPED;
+                          status->value.sig = TARGET_SIGNAL_INT;
                           break;
 			}
 		      record_beneath_to_resume (record_beneath_to_resume_ops,

Attachment: prec-fix-error-handler.txt
Description: Text document


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