From patchwork Wed Sep 30 17:23:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Breazeal X-Patchwork-Id: 8892 Received: (qmail 58543 invoked by alias); 30 Sep 2015 17:23:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 58529 invoked by uid 89); 30 Sep 2015 17:23:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Sep 2015 17:23:41 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1ZhL6Q-0004Gh-5v from Don_Breazeal@mentor.com ; Wed, 30 Sep 2015 10:23:38 -0700 Received: from build4-lucid-cs (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Wed, 30 Sep 2015 10:23:37 -0700 Received: by build4-lucid-cs (Postfix, from userid 1905) id 7C3FA4105C; Wed, 30 Sep 2015 10:23:36 -0700 (PDT) From: Don Breazeal To: , Subject: [ob/pushed] Call strprefix instead of strncmp in event parsing Date: Wed, 30 Sep 2015 10:23:37 -0700 Message-ID: <1443633817-28868-1-git-send-email-donb@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This fixes a typo that used strncmp instead of strprefix when checking for an exec event in a stop reply packet, pointed out by Pedro here: https://sourceware.org/ml/gdb-patches/2015-09/msg00670.html. Tested by running exec-related tests on x86_64 Linux and pushed as obvious. gdb/ChangeLog: * remote.c (remote_parse_stop_reply): Call strprefix instead of strncmp. --- gdb/ChangeLog | 5 +++++ gdb/remote.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3d883a1..2c2aa9e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-09-30 Don Breazeal + + * remote.c (remote_parse_stop_reply): Call strprefix instead + of strncmp. + 2015-09-30 Simon Marchi * gdbarch.sh (struct gdbarch_info): Change tdep_info's type to void *. diff --git a/gdb/remote.c b/gdb/remote.c index ea6ff6b..f40f791 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6227,7 +6227,7 @@ Packet: '%s'\n"), event->ws.kind = TARGET_WAITKIND_VFORK_DONE; p = skip_to_semicolon (p1 + 1); } - else if (strncmp (p, "exec", p1 - p) == 0) + else if (strprefix (p, p1, "exec")) { ULONGEST ignored; char pathname[PATH_MAX];