From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25006 invoked by alias); 23 May 2013 17:44:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24996 invoked by uid 89); 23 May 2013 17:44:25 -0000 X-Spam-SWARE-Status: No, score=-8.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 17:44:24 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4NHiNl3031681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 May 2013 13:44:23 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4NHiM2r011647; Thu, 23 May 2013 13:44:22 -0400 Message-ID: <519E5575.7000701@redhat.com> Date: Thu, 23 May 2013 17:44:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH 4/5] range stepping: gdbserver (x86 GNU/Linux) References: <20130514191026.13213.39574.stgit@brno.lan> <20130514191054.13213.58686.stgit@brno.lan> <87obcd48vj.fsf@fleche.redhat.com> In-Reply-To: <87obcd48vj.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00885.txt.bz2 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