[pushed,v3,1/4] Extended-remote follow exec

Message ID 86lhc83vtp.fsf@gmail.com
State New, archived
Headers

Commit Message

Yao Qi Sept. 15, 2015, 8:56 a.m. UTC
  Don Breazeal <donb@codesourcery.com> writes:

Hi Don,
I happen to read the code you pushed in some days ago...

> @@ -2111,6 +2112,12 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
>  		  if (target_supports_vfork_events ())
>  		    report_vfork_events = 1;
>  		}
> +	      if (strcmp (p, "exec-events+") == 0)

Shouldn't we use "else if"?

> +		{
> +		  /* GDB supports and wants exec events if possible.  */
> +		  if (target_supports_exec_events ())
> +		    report_exec_events = 1;
> +		}
>  	      else
>  		target_process_qsupported (p);
  

Comments

Don Breazeal Sept. 15, 2015, 4:12 p.m. UTC | #1
On 9/15/2015 1:56 AM, Yao Qi wrote:
> Don Breazeal <donb@codesourcery.com> writes:
> 
> Hi Don,
> I happen to read the code you pushed in some days ago...
> 
>> @@ -2111,6 +2112,12 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
>>  		  if (target_supports_vfork_events ())
>>  		    report_vfork_events = 1;
>>  		}
>> +	      if (strcmp (p, "exec-events+") == 0)
> 
> Shouldn't we use "else if"?

Hi Yao,
Yes, definitely "else if".  Fortunately this didn't break anything.  Do
you want to go ahead and push the fix, or shall I do it?
thanks
--Don

> 
>> +		{
>> +		  /* GDB supports and wants exec events if possible.  */
>> +		  if (target_supports_exec_events ())
>> +		    report_exec_events = 1;
>> +		}
>>  	      else
>>  		target_process_qsupported (p);
>
  
Yao Qi Sept. 15, 2015, 4:31 p.m. UTC | #2
Don Breazeal <donb@codesourcery.com> writes:

> Yes, definitely "else if".  Fortunately this didn't break anything.  Do
> you want to go ahead and push the fix, or shall I do it?

I've pushed it in.
  

Patch

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 1481c47..c82c232 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2112,7 +2112,7 @@  handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
 		  if (target_supports_vfork_events ())
 		    report_vfork_events = 1;
 		}
-	      if (strcmp (p, "exec-events+") == 0)
+	      else if (strcmp (p, "exec-events+") == 0)
 		{
 		  /* GDB supports and wants exec events if possible.  */
 		  if (target_supports_exec_events ())