Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/5] range stepping: gdbserver (x86 GNU/Linux)
Date: Thu, 23 May 2013 17:44:00 -0000	[thread overview]
Message-ID: <519E5575.7000701@redhat.com> (raw)
In-Reply-To: <87obcd48vj.fsf@fleche.redhat.com>

On 05/14/2013 09:14 PM, Tom Tromey wrote:
> Pedro> +  /* Note that all addresses are always "out the step range" when
> Pedro> +     there's no range to begin with.  */
> 
> I think "out of the step range".

Thanks.  I fixed that one.

> Pedro> +      else if (p[0] == 'r')
> Pedro> +	{
> Pedro> +	  char *p1;
> Pedro> +
> Pedro> +	  p = p + 1;
> Pedro> +	  p1 = strchr (p, ',');
> Pedro> +	  decode_address (&resume_info[i].step_range_start, p, p1 - p);
> Pedro> +
> Pedro> +	  p = p1 + 1;
> Pedro> +	  p1 = strchr (p, ':');
> Pedro> +	  decode_address (&resume_info[i].step_range_end, p, p1 - p);
> Pedro> +
> Pedro> +	  p = p1;
> Pedro> +	}
> 
> I don't know much about gdbserver, but reading this made me wonder if it
> needs to do any kind of error-checking on its input.

Yeah, it doesn't tend to do that much validation.  Perhaps we should.

> Like - what if the wrong format is sent, 

Crash in many different places most likely.  When looking at
validation, I'm more looking at making it easier for possible
future packet extensions not break older gdbserver.

In this case, I do believe this bit:

+	  p1 = strchr (p, ':');
+	  decode_address (&resume_info[i].step_range_end, p, p1 - p);

should not expect the ':' to be there.  An action
without a ptid is valid. I means it applies to all and
is handled as the default action, further below:

      if (p[0] == 0)
	{
	  resume_info[i].thread = minus_one_ptid;
	  default_action = resume_info[i];

	  /* Note: we don't increment i here, we'll overwrite this entry
	     the next time through.  */
	}
      else if (p[0] == ':')

I'll fix it in a follow up.

> or if the range end is before the range start?

Yeah, considering that MIPS has signed addresses, I'm
leaving this one open.

-- 
Pedro Alves


  reply	other threads:[~2013-05-23 17:44 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 19:10 [PATCH 0/5 V3] target-assisted range stepping Pedro Alves
2013-05-14 19:10 ` [PATCH 4/5] range stepping: gdbserver (x86 GNU/Linux) Pedro Alves
2013-05-14 19:47   ` Eli Zaretskii
2013-05-14 20:14   ` Tom Tromey
2013-05-23 17:44     ` Pedro Alves [this message]
2013-05-24 11:33       ` Pedro Alves
2013-05-15 12:14   ` Yao Qi
2013-05-20 18:01     ` Pedro Alves
2013-05-23  0:56   ` Yao Qi
2013-05-23 17:26     ` Pedro Alves
2013-05-14 19:10 ` [PATCH 2/5] Convert rs->support_vCont_t to a struct Pedro Alves
2013-05-14 19:40   ` Tom Tromey
2013-05-14 19:10 ` [PATCH 1/5] Factor out in-stepping-range checks Pedro Alves
2013-05-14 19:37   ` Tom Tromey
2013-05-14 19:10 ` [PATCH 3/5] range stepping: gdb Pedro Alves
2013-05-14 19:46   ` Eli Zaretskii
2013-05-15 10:23     ` Pedro Alves
2013-05-15 11:22       ` Eli Zaretskii
2013-05-15 12:39         ` Pedro Alves
2013-05-15 13:46           ` Eli Zaretskii
2013-05-15 13:58             ` Pedro Alves
2013-05-15 18:20               ` Pedro Alves
2013-05-16  6:08                 ` Eli Zaretskii
2013-05-20 18:43                   ` Pedro Alves
2013-05-20 19:05                     ` Eli Zaretskii
2013-05-23  0:47                     ` Yao Qi
2013-05-23 17:22                       ` Pedro Alves
2013-05-14 19:11 ` [PATCH 5/5] range stepping: tests Pedro Alves
2013-05-22 14:32   ` Yao Qi
2013-05-23 17:34     ` Pedro Alves
2013-05-23 18:03     ` Pedro Alves
2013-05-24  2:27       ` Yao Qi
2013-05-24  9:45         ` Pedro Alves
2013-05-24  9:57           ` Yao Qi
2013-05-14 20:21 ` [PATCH 0/5 V3] target-assisted range stepping Tom Tromey
2013-05-23 17:44   ` Pedro Alves
2013-05-23  1:02 ` Yao Qi
2013-05-23 17:46   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519E5575.7000701@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox