From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH 2/7] constify probe.c function
Date: Wed, 11 Jun 2014 18:53:00 -0000 [thread overview]
Message-ID: <1402512797-6082-3-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1402512797-6082-1-git-send-email-tromey@redhat.com>
This constifies an argument to info_probes_for_ops.
2014-06-11 Tom Tromey <tromey@redhat.com>
* 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,
--
1.9.3
next prev parent reply other threads:[~2014-06-11 18:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 18:53 [PATCH 0/7] more constification Tom Tromey
2014-06-11 18:53 ` [PATCH 1/7] constify struct block in some places Tom Tromey
2014-06-11 18:53 ` [PATCH 6/7] constify some blockvector APIs Tom Tromey
2014-06-11 18:53 ` Tom Tromey [this message]
2014-06-11 18:53 ` [PATCH 3/7] fix up parse_cli_boolean_value after rebase Tom Tromey
2014-06-11 18:53 ` [PATCH 4/7] remove unneeded cast in symtab.c Tom Tromey
2014-06-11 19:46 ` [PATCH 5/7] constify complete_line Tom Tromey
2014-06-11 19:48 ` [PATCH 7/7] make common_block const Tom Tromey
2014-06-12 8:45 ` [PATCH 0/7] more constification Joel Brobecker
2014-06-13 16:50 ` Tom Tromey
2014-06-13 19:01 ` Maciej W. Rozycki
2014-06-23 13:25 ` Joel Brobecker
2014-06-30 8:55 ` Maciej W. Rozycki
2014-07-07 14:27 ` Joel Brobecker
2014-06-12 13:04 ` Pedro Alves
2014-06-13 16:52 ` Tom Tromey
2014-06-18 14:29 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402512797-6082-3-git-send-email-tromey@redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).