From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8790 invoked by alias); 14 Mar 2011 10:13:54 -0000 Received: (qmail 8782 invoked by uid 22791); 14 Mar 2011 10:13:54 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 10:13:49 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 41992CB0283 for ; Mon, 14 Mar 2011 11:13:47 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7A1nESrW-3Yl for ; Mon, 14 Mar 2011 11:13:44 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 3FD87CB0262 for ; Mon, 14 Mar 2011 11:13:44 +0100 (CET) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [RFA] make first parameter of to_lookup_symbol const char * Date: Mon, 14 Mar 2011 11:56:00 -0000 Message-Id: <58CFFAD9-1C02-4AD8-B416-FC48D1A7F006@adacore.com> To: "gdb-patches@sourceware.org ml" Mime-Version: 1.0 (Apple Message framework v1082) X-IsSubscribed: yes 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 X-SW-Source: 2011-03/txt/msg00710.txt.bz2 Hi, is there any good reason why the NAME parameter is 'char *' instead of 'con= st 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 * 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); =20 static void debug_to_unload (char *, int); =20 -static int debug_to_lookup_symbol (char *, CORE_ADDR *); +static int debug_to_lookup_symbol (const char *, CORE_ADDR *); =20 static int debug_to_can_run (void); =20 @@ -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) } =20 static int -debug_to_lookup_symbol (char *name, CORE_ADDR *addrp) +debug_to_lookup_symbol (const char *name, CORE_ADDR *addrp) { int retval; =20 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 *,=20 char *, char *, char **, int); void (*to_post_startup_inferior) (ptid_t);