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: [PATCH v2 4/7] Support breakpoint kinds for software breakpoints in GDBServer.


On 10/16/2015 08:44 PM, Antoine Tremblay wrote:

> Humm thinking more about it however if we were to apply the same logic 
> to pc and pcfull.
> 
> Removing the pc from the struct would cause a call to 
> breakpoint_kind_from_pc to be mandatory.
> 
> Would you see too pc to be removed ?
> 

I was seeing pcfull being removed, actually.

Z0 breakpoints always have their address already adjusted by GDB, right?

You had:

@@ -774,9 +802,15 @@ set_breakpoint_at (CORE_ADDR where, int (*handler) (CORE_ADDR))
 {
   int err_ignored;

+  const unsigned char *breakpoint_data;
+  int breakpoint_len;
+  CORE_ADDR pc = where;
+
+  breakpoint_data = the_target->breakpoint_from_pc (&pc, &breakpoint_len);
+
   return set_breakpoint (other_breakpoint, raw_bkpt_type_sw,
-			 where, breakpoint_len, handler,
-			 &err_ignored);
+			 where, pc, breakpoint_data, breakpoint_len,
+			 breakpoint_len, handler, &err_ignored);
 }


But I think you should be able to instead do:

@@ -774,9 +802,15 @@ set_breakpoint_at (CORE_ADDR where, int (*handler) (CORE_ADDR))
 {
   int err_ignored;

+  CORE_ADDR adjusted_pc = where;
+  int bp_kind;
+
+  bp_kind = the_target->breakpoint_kind_from_pc (&adjusted_pc);
+
   return set_breakpoint (other_breakpoint, raw_bkpt_type_sw,
-			 where, breakpoint_len, handler,
+			 adjusted_pc, bp_kind, handler,
			 &err_ignored);
 }

Thanks,
Pedro Alves


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