Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: [RFA] make first parameter of to_lookup_symbol const char *
Date: Mon, 14 Mar 2011 11:56:00 -0000	[thread overview]
Message-ID: <58CFFAD9-1C02-4AD8-B416-FC48D1A7F006@adacore.com> (raw)

Hi,

is there any good reason why the NAME parameter is 'char *' instead of 'const char *' ?  I can't see any of them.

This patch was tested only by recompiling gdb for powerpc-elf.

BTW, it looks like no target defines this operation...

Tristan.

2011-03-14  Tristan Gingold  <gingold@adacore.com>

	* target.h (target_ops): Make NAME parameter of to_lookup_symbol
	const char*
	* target.c (debug_to_lookup_symbol): Constify NAME parameter.
	Adjust prototype.
	(update_current_target): Adjust.

diff --git a/gdb/target.c b/gdb/target.c
index c155716..0e6d652 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -151,7 +151,7 @@ static void debug_to_load (char *, int);
 
 static void debug_to_unload (char *, int);
 
-static int debug_to_lookup_symbol (char *, CORE_ADDR *);
+static int debug_to_lookup_symbol (const char *, CORE_ADDR *);
 
 static int debug_to_can_run (void);
 
@@ -781,7 +781,7 @@ update_current_target (void)
 	    (void (*) (char *, int))
 	    tcomplain);
   de_fault (to_lookup_symbol,
-	    (int (*) (char *, CORE_ADDR *))
+	    (int (*) (const char *, CORE_ADDR *))
 	    nosymbol);
   de_fault (to_post_startup_inferior,
 	    (void (*) (ptid_t))
@@ -3679,7 +3679,7 @@ debug_to_unload (char *args, int from_tty)
 }
 
 static int
-debug_to_lookup_symbol (char *name, CORE_ADDR *addrp)
+debug_to_lookup_symbol (const char *name, CORE_ADDR *addrp)
 {
   int retval;
 
diff --git a/gdb/target.h b/gdb/target.h
index b8db4bc..2318b9d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -478,7 +478,7 @@ struct target_ops
     void (*to_kill) (struct target_ops *);
     void (*to_load) (char *, int);
     void (*to_unload) (char *, int);
-    int (*to_lookup_symbol) (char *, CORE_ADDR *);
+    int (*to_lookup_symbol) (const char *, CORE_ADDR *);
     void (*to_create_inferior) (struct target_ops *, 
 				char *, char *, char **, int);
     void (*to_post_startup_inferior) (ptid_t);


             reply	other threads:[~2011-03-14 10:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 11:56 Tristan Gingold [this message]
2011-03-14 13:53 ` Jan Kratochvil
2011-03-16 14:02   ` Joel Brobecker
2011-03-16 15:03     ` Tom Tromey
2011-03-16 20:03     ` Stan Shebs
2011-03-17 14:58     ` Joel Brobecker
2011-03-14 14:03 ` Pedro Alves
2011-03-14 14:21   ` Tristan Gingold
2011-03-15  8:26     ` Joel Brobecker

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=58CFFAD9-1C02-4AD8-B416-FC48D1A7F006@adacore.com \
    --to=gingold@adacore.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