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 13/16] move sizeof_pkt into remote_trace_find


On 06/21/2013 06:25 PM, Tom Tromey wrote:
> The global sizeof_pkt is only used in remote_trace_find, like so:
> 
>   reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt);
> 
> I think in this situation it is more correct to use the recorded size
> of the buffer.  Otherwise it seems that some skew could result.

Yeah.  A leftover from making the tracepoint bits go through
the target vector.  A few of these globals, along with all
the tracepoint RSP handling, used to live in tracepoint.c,
got moved to remote.c, and then some of these redundant globals
were never eliminated.

> 
> 	* remote.c (sizeof_pkt): Remove.
> 	(remote_trace_find): Use rs->buf, not sizeof_pkt.
> ---
>  gdb/remote.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/gdb/remote.c b/gdb/remote.c
> index 287b701..94aa5a8 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -496,8 +496,6 @@ struct remote_arch_state
>    long remote_packet_size;
>  };
>  
> -long sizeof_pkt = 2000;
> -
>  /* Utility: generate error from an incoming stub packet.  */
>  static void
>  trace_error (char *buf)
> @@ -10974,7 +10972,7 @@ remote_trace_find (enum trace_find_type type, int num,
>      }
>  
>    putpkt (rs->buf);
> -  reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt);
> +  reply = remote_get_noisy_reply (&(rs->buf), &rs->buf_size);
>    if (*reply == '\0')
>      error (_("Target does not support this command."));
>  
> 


-- 
Pedro Alves


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