public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC stub-side break conditions 2/5] Protocol changes
@ 2012-01-05 14:56 Luis Machado
  2012-01-06 21:09 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2012-01-05 14:56 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

Hi,

This patch adds the required bits to the protocol, making GDB aware of 
the "ConditionalBreakpoints" feature and adding set/show commands for 
"conditional-breakpoints-packet".

Luis
lgustavo@codesourcery.com

[-- Attachment #2: 0001-break_support_conditions.diff --]
[-- Type: text/x-patch, Size: 2991 bytes --]

2012-01-05  Luis Machado  <lgustavo@codesourcery.com>

	* remote.c (remote_state) <cond_breakpoints>: New field.
	(PACKET_ConditionalBreakpoints): New enum.
	(remote_cond_breakpoint_feature): New function.
	(remote_protocol_features): Add new ConditionalBreakpoints entry.
	(remote_supports_cond_breakpoints): New function.
	(_initialize_remote): Add new packet configuration for
	target-side conditional breakpoints.

Index: gdb/gdb/remote.c
===================================================================
--- gdb.orig/gdb/remote.c	2012-01-04 14:02:33.750431998 -0200
+++ gdb/gdb/remote.c	2012-01-04 14:03:00.810431999 -0200
@@ -315,6 +315,10 @@ struct remote_state
   /* True if the stub reports support for conditional tracepoints.  */
   int cond_tracepoints;
 
+  /* True if the stub reports support for target-side breakpoint
+     conditions.  */
+  int cond_breakpoints;
+
   /* True if the stub reports support for fast tracepoints.  */
   int fast_tracepoints;
 
@@ -1262,6 +1266,7 @@ enum {
   PACKET_qXfer_siginfo_write,
   PACKET_qAttached,
   PACKET_ConditionalTracepoints,
+  PACKET_ConditionalBreakpoints,
   PACKET_FastTracepoints,
   PACKET_StaticTracepoints,
   PACKET_InstallInTrace,
@@ -3680,6 +3685,16 @@ remote_cond_tracepoint_feature (const st
 }
 
 static void
+remote_cond_breakpoint_feature (const struct protocol_feature *feature,
+				enum packet_support support,
+				const char *value)
+{
+  struct remote_state *rs = get_remote_state ();
+
+  rs->cond_breakpoints = (support == PACKET_ENABLE);
+}
+
+static void
 remote_fast_tracepoint_feature (const struct protocol_feature *feature,
 				enum packet_support support,
 				const char *value)
@@ -3773,6 +3788,8 @@ static struct protocol_feature remote_pr
     PACKET_qXfer_siginfo_write },
   { "ConditionalTracepoints", PACKET_DISABLE, remote_cond_tracepoint_feature,
     PACKET_ConditionalTracepoints },
+  { "ConditionalBreakpoints", PACKET_DISABLE, remote_cond_breakpoint_feature,
+    PACKET_ConditionalBreakpoints },
   { "FastTracepoints", PACKET_DISABLE, remote_fast_tracepoint_feature,
     PACKET_FastTracepoints },
   { "StaticTracepoints", PACKET_DISABLE, remote_static_tracepoint_feature,
@@ -9763,6 +9780,14 @@ remote_supports_cond_tracepoints (void)
 }
 
 int
+remote_supports_cond_breakpoints (void)
+{
+  struct remote_state *rs = get_remote_state ();
+
+  return rs->cond_breakpoints;
+}
+
+int
 remote_supports_fast_tracepoints (void)
 {
   struct remote_state *rs = get_remote_state ();
@@ -11165,6 +11190,11 @@ Show the maximum size of the address (in
   add_packet_config_cmd (&remote_protocol_packets[PACKET_ConditionalTracepoints],
 			 "ConditionalTracepoints",
 			 "conditional-tracepoints", 0);
+
+  add_packet_config_cmd (&remote_protocol_packets[PACKET_ConditionalBreakpoints],
+			 "ConditionalBreakpoints",
+			 "conditional-breakpoints", 0);
+
   add_packet_config_cmd (&remote_protocol_packets[PACKET_FastTracepoints],
 			 "FastTracepoints", "fast-tracepoints", 0);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC stub-side break conditions 2/5] Protocol changes
  2012-01-05 14:56 [RFC stub-side break conditions 2/5] Protocol changes Luis Machado
@ 2012-01-06 21:09 ` Tom Tromey
  2012-01-06 22:39   ` Luis Machado
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-01-06 21:09 UTC (permalink / raw)
  To: luis_gustavo; +Cc: gdb-patches

>>>>> "Luis" == Luis Machado <luis_gustavo@mentor.com> writes:

Luis>  int
Luis> +remote_supports_cond_breakpoints (void)
Luis> +{
Luis> +  struct remote_state *rs = get_remote_state ();
Luis> +
Luis> +  return rs->cond_breakpoints;
Luis> +}

I think this could be static.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC stub-side break conditions 2/5] Protocol changes
  2012-01-06 21:09 ` Tom Tromey
@ 2012-01-06 22:39   ` Luis Machado
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Machado @ 2012-01-06 22:39 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 01/06/2012 07:08 PM, Tom Tromey wrote:
>>>>>> "Luis" == Luis Machado<luis_gustavo@mentor.com>  writes:
> Luis>   int
> Luis>  +remote_supports_cond_breakpoints (void)
> Luis>  +{
> Luis>  +  struct remote_state *rs = get_remote_state ();
> Luis>  +
> Luis>  +  return rs->cond_breakpoints;
> Luis>  +}
>
> I think this could be static.
>

True. Fixed.

Thanks!

-- 
Luis
lgustavo@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-06 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-05 14:56 [RFC stub-side break conditions 2/5] Protocol changes Luis Machado
2012-01-06 21:09 ` Tom Tromey
2012-01-06 22:39   ` Luis Machado

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).