From patchwork Wed Jun 11 18:53:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1447 Received: (qmail 12408 invoked by alias); 11 Jun 2014 18:53:26 -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 12196 invoked by uid 89); 11 Jun 2014 18:53:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jun 2014 18:53:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5BIrLtB004376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 11 Jun 2014 14:53:21 -0400 Received: from barimba.redhat.com (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5BIrJRG005158; Wed, 11 Jun 2014 14:53:20 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/7] constify probe.c function Date: Wed, 11 Jun 2014 12:53:12 -0600 Message-Id: <1402512797-6082-3-git-send-email-tromey@redhat.com> In-Reply-To: <1402512797-6082-1-git-send-email-tromey@redhat.com> References: <1402512797-6082-1-git-send-email-tromey@redhat.com> This constifies an argument to info_probes_for_ops. 2014-06-11 Tom Tromey * probe.c (info_probes_for_ops): Make "arg" const. * probe.h (info_probes_for_ops): Update. --- gdb/ChangeLog | 5 +++++ gdb/probe.c | 9 +++++---- gdb/probe.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/probe.c b/gdb/probe.c index 838d9f9..859e6e7 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -486,7 +486,8 @@ get_number_extra_fields (const struct probe_ops *pops) /* See comment in probe.h. */ void -info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops) +info_probes_for_ops (const char *arg, int from_tty, + const struct probe_ops *pops) { char *provider, *probe_name = NULL, *objname = NULL; struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); @@ -501,17 +502,17 @@ info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops) struct gdbarch *gdbarch = get_current_arch (); /* Do we have a `provider:probe:objfile' style of linespec? */ - provider = extract_arg (&arg); + provider = extract_arg_const (&arg); if (provider) { make_cleanup (xfree, provider); - probe_name = extract_arg (&arg); + probe_name = extract_arg_const (&arg); if (probe_name) { make_cleanup (xfree, probe_name); - objname = extract_arg (&arg); + objname = extract_arg_const (&arg); if (objname) make_cleanup (xfree, objname); } diff --git a/gdb/probe.h b/gdb/probe.h index aa8aba8..b4ff0a6 100644 --- a/gdb/probe.h +++ b/gdb/probe.h @@ -230,7 +230,7 @@ extern VEC (probe_p) *find_probes_in_objfile (struct objfile *objfile, function that can be used by the probe backends to print their `info probe TYPE'. */ -extern void info_probes_for_ops (char *arg, int from_tty, +extern void info_probes_for_ops (const char *arg, int from_tty, const struct probe_ops *pops); /* Return the `cmd_list_element' associated with the `info probes' command,