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/RFC Prec] Add process record skip 1/6 (breakpoint)


Update follow cvs-head.

---
 breakpoint.c |   27 +++++++++++++++++++++++++++
 breakpoint.h |   15 +++++++++++++++
 2 files changed, 42 insertions(+)

--- a/breakpoint.c
+++ b/breakpoint.c
@@ -3409,6 +3409,7 @@ bpstat_what (bpstat bs)
   struct bpstat_what retval;

   retval.call_dummy = 0;
+  retval.record_skip = bp_none;
   for (; bs != NULL; bs = bs->next)
     {
       enum class bs_class = no_effect;
@@ -3509,6 +3510,11 @@ bpstat_what (bpstat bs)
 	  internal_error (__FILE__, __LINE__,
 			  _("bpstat_what: bp_tracepoint encountered"));
 	  break;
+	case bp_record_skip_start:
+	case bp_record_skip_stop:
+	  bs_class = bp_nostop;
+	  retval.record_skip = bs->breakpoint_at->owner->type;
+	  break;
 	}
       current_action = table[(int) bs_class][(int) current_action];
     }
@@ -4387,6 +4393,8 @@ allocate_bp_location (struct breakpoint
     case bp_overlay_event:
     case bp_jit_event:
     case bp_longjmp_master:
+    case bp_record_skip_start:
+    case bp_record_skip_stop:
       loc->loc_type = bp_loc_software_breakpoint;
       break;
     case bp_hardware_breakpoint:
@@ -4774,6 +4782,25 @@ disable_breakpoints_in_unloaded_shlib (s
   }
 }

+struct breakpoint *
+create_record_skip_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address,
+                               enum bptype type)
+{
+  return create_internal_breakpoint (gdbarch, address, type);
+}
+
+void
+remove_record_skip_breakpoint (CORE_ADDR address, int all)
+{
+  struct breakpoint *b, *temp;
+
+  ALL_BREAKPOINTS_SAFE (b, temp)
+    if ((b->type == bp_record_skip_start
+	 || b->type == bp_record_skip_stop)
+	&& (all || b->loc->requested_address == address))
+      delete_breakpoint (b);
+}
+
 /* FORK & VFORK catchpoints.  */

 /* Implement the "insert" breakpoint_ops method for fork catchpoints.  */
--- a/breakpoint.h
+++ b/breakpoint.h
@@ -123,6 +123,13 @@ enum bptype

     /* Event for JIT compiled code generation or deletion.  */
     bp_jit_event,
+
+    /* When inferior is broken by breakpoint bp_record_skip_start,
+       process record and replay function is enable and GDB is in
+       record mode, GDB will stop record the execute log until
+       inferior is broken by bp_record_skip_stop. */
+    bp_record_skip_start,
+    bp_record_skip_stop,
   };

 /* States of enablement of breakpoint. */
@@ -573,6 +580,8 @@ struct bpstat_what
        continuing from a call dummy without popping the frame is not a
        useful one).  */
     int call_dummy;
+
+    enum bptype record_skip;
   };

 /* The possible return values for print_bpstat, print_it_normal,
@@ -886,6 +895,12 @@ extern void remove_thread_event_breakpoi

 extern void disable_breakpoints_in_shlibs (void);

+extern struct breakpoint *create_record_skip_breakpoint
+                            (struct gdbarch *gdbarch, CORE_ADDR address,
+                             enum bptype type);
+
+extern void remove_record_skip_breakpoint (CORE_ADDR address, int all);
+
 /* This function returns TRUE if ep is a catchpoint. */
 extern int ep_is_catchpoint (struct breakpoint *);

Attachment: 1-skip-record-breakpoint.txt
Description: Text document


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