From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55927 invoked by alias); 3 Oct 2016 21:54: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 55907 invoked by uid 89); 3 Oct 2016 21:54:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*RU:69.89.20.226, Hx-spam-relays-external:69.89.20.226, Hx-spam-relays-external:cmgw2, Hx-languages-length:1244 X-HELO: gproxy10-pub.mail.unifiedlayer.com Received: from gproxy10-pub.mail.unifiedlayer.com (HELO gproxy10-pub.mail.unifiedlayer.com) (69.89.20.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 03 Oct 2016 21:54:15 +0000 Received: (qmail 15369 invoked by uid 0); 3 Oct 2016 21:54:13 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy10.mail.unifiedlayer.com with SMTP; 3 Oct 2016 21:54:13 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id r9u81t01S2f2jeq019uBZw; Mon, 03 Oct 2016 15:54:11 -0600 X-Authority-Analysis: v=2.1 cv=dJg1xopb c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=zstS-IiYAAAA:8 a=kiwEfwDu_pPoUSQygJgA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 71-218-192-86.hlrn.qwest.net ([71.218.192.86]:36324 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1brBBa-0001qc-4M; Mon, 03 Oct 2016 15:54:10 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location Date: Mon, 03 Oct 2016 21:54:00 -0000 Message-Id: <1475531646-18049-3-git-send-email-tom@tromey.com> In-Reply-To: <1475531646-18049-1-git-send-email-tom@tromey.com> References: <1475531646-18049-1-git-send-email-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1brBBa-0001qc-4M X-Source-Sender: 71-218-192-86.hlrn.qwest.net (bapiya.Home) [71.218.192.86]:36324 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00027.txt.bz2 This bug points out that string_to_explicit_location compares a char* against '\0'; whereas comparing against NULL is more normal. 2016-10-03 Tom Tromey PR breakpoints/20653: * location.c (string_to_explicit_location): Use NULL, not '\0'. --- gdb/ChangeLog | 5 +++++ gdb/location.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 434f750..7a7ba1c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-10-03 Tom Tromey + PR breakpoints/20653: + * location.c (string_to_explicit_location): Use NULL, not '\0'. + +2016-10-03 Tom Tromey + PR symtab/20652: * psymtab.c (psymbol_compare): Correctly compare "ginfo.value" fields. diff --git a/gdb/location.c b/gdb/location.c index 65116c7..8dce21a 100644 --- a/gdb/location.c +++ b/gdb/location.c @@ -524,7 +524,7 @@ string_to_explicit_location (const char **argp, character is an explicit location. "-p" is reserved, though, for probe locations. */ if (argp == NULL - || *argp == '\0' + || *argp == NULL || *argp[0] != '-' || !isalpha ((*argp)[1]) || ((*argp)[0] == '-' && (*argp)[1] == 'p')) -- 2.7.4