From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5686 invoked by alias); 13 Mar 2014 02:35:12 -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 5655 invoked by uid 89); 13 Mar 2014 02:35:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 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; Thu, 13 Mar 2014 02:35:09 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WNvUA-0001P2-IV from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 12 Mar 2014 19:35:06 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 12 Mar 2014 19:35:06 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Wed, 12 Mar 2014 19:35:05 -0700 From: Yao Qi To: Subject: [PATCH 2/5] Change argument 'args' of get_tracepoint_by_number to char * Date: Thu, 13 Mar 2014 02:35:00 -0000 Message-ID: <1394677950-4054-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1394677950-4054-1-git-send-email-yao@codesourcery.com> References: <1394677950-4054-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00305.txt.bz2 We pass the reference to a char pointer to get_tracepoint_by_number, but the char pointer isn't used afterwards, so looks it should be fine to pass a char pointer to get_tracepoint_by_number. gdb: 2014-03-13 Yao Qi * breakpoint.c (get_tracepoint_by_number): Change type of 'args' to 'char *'. Update pointer checking. All callers updated. * breakpoint.h (get_tracepoint_by_number): Update declaration. --- gdb/breakpoint.c | 10 +++++----- gdb/breakpoint.h | 2 +- gdb/tracepoint.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 800cead..211c2aa 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -15532,7 +15532,7 @@ trace_pass_command (char *args, int from_tty) } else if (*args == '\0') { - t1 = get_tracepoint_by_number (&args); + t1 = get_tracepoint_by_number (args); if (t1) trace_pass_set_count (t1, count, from_tty); } @@ -15592,12 +15592,12 @@ get_tracepoint_by_number_on_target (int num) (tracepoint_count) is returned. */ struct tracepoint * -get_tracepoint_by_number (char **arg) +get_tracepoint_by_number (char *arg) { struct breakpoint *t; int tpnum; - if (arg == NULL || *arg == NULL || ! **arg) + if (arg == NULL || *arg == 0) { if (tracepoint_count == 0) { @@ -15609,9 +15609,9 @@ get_tracepoint_by_number (char **arg) } else { - char *instring = *arg; + char *instring = arg; - tpnum = get_number (arg); + tpnum = get_number (&arg); if (tpnum == 0) { diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index c1ed2e6..c240516 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1490,7 +1490,7 @@ extern struct tracepoint *get_tracepoint_by_number_on_target (int num); /* Find a tracepoint by parsing a number in the supplied string. */ extern struct tracepoint * - get_tracepoint_by_number (char **arg); + get_tracepoint_by_number (char *arg); /* Return a vector of all tracepoints currently defined. The vector is newly allocated; the caller should free when done with it. */ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index cea40e3..a5bc7d1 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -653,7 +653,7 @@ trace_actions_command (char *args, int from_tty) struct tracepoint *t; struct command_line *l; - t = get_tracepoint_by_number (&args); + t = get_tracepoint_by_number (args); if (t) { char *tmpbuf = -- 1.7.7.6