From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31352 invoked by alias); 22 Feb 2012 05:29:34 -0000 Received: (qmail 31340 invoked by uid 22791); 22 Feb 2012 05:29:33 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BT,TW_DB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Feb 2012 05:29:18 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1M5TH8Q022298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 Feb 2012 00:29:17 -0500 Received: from mesquite.lan (ovpn-113-100.phx2.redhat.com [10.3.113.100]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1M5TGCw025369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 22 Feb 2012 00:29:17 -0500 Date: Wed, 22 Feb 2012 05:29:00 -0000 From: Kevin Buettner To: insight@sourceware.org Subject: [RFA] GDB API Updates Message-ID: <20120221222916.263f6dd1@mesquite.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00010.txt.bz2 I ran into some build errors while building insight earlier today. (Actually, they're warnings, but I had -Werror set.) I found that the return type of some gdb functions have been changed from char * to const char *. The patch below adjusts insight specific files to match the rest of gdb. Okay? * generic/gdbtk-cmds.h (pc_function_name): Make return type const. * generic/gdbtk-bp.c (gdb_get_breakpoint_info) (gdb_get_tracepoint_info): Make char * variables const to match recent GDB API changes. * generic/gdbtk-stack.c (get_frame_name): Likewise. * generic/gdbtk-cmds.c (gdb_get_function_command, gdb_listfuncs) (gdb_loc, perror_with_name_wrapper): Likewise. (pc_function_name): Likewise, plus change return type to be const. Index: gdbtk/generic/gdbtk-bp.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v retrieving revision 1.44 diff -u -p -r1.44 gdbtk-bp.c --- gdbtk/generic/gdbtk-bp.c 17 Dec 2011 19:30:39 -0000 1.44 +++ gdbtk/generic/gdbtk-bp.c 22 Feb 2012 05:10:55 -0000 @@ -282,7 +282,7 @@ gdb_get_breakpoint_info (ClientData clie int bpnum; struct breakpoint *b; struct watchpoint *w; - char *funcname, *filename; + const char *funcname, *filename; int isPending = 0; Tcl_Obj *new_obj; @@ -690,7 +690,7 @@ gdb_get_tracepoint_info (ClientData clie struct breakpoint *bp; struct command_line *cl; Tcl_Obj *action_list; - char *filename, *funcname; + const char *filename, *funcname; if (objc != 2) { Index: gdbtk/generic/gdbtk-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v retrieving revision 1.123 diff -u -p -r1.123 gdbtk-cmds.c --- gdbtk/generic/gdbtk-cmds.c 17 Dec 2011 19:30:39 -0000 1.123 +++ gdbtk/generic/gdbtk-cmds.c 22 Feb 2012 05:10:55 -0000 @@ -1021,7 +1021,7 @@ static int gdb_get_function_command (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - char *function; + const char *function; struct symtabs_and_lines sals; char *args; @@ -1513,7 +1513,7 @@ gdb_listfuncs (clientData, interp, objc, if (SYMBOL_CLASS (sym) == LOC_BLOCK) { - char *name = SYMBOL_DEMANGLED_NAME (sym); + const char *name = SYMBOL_DEMANGLED_NAME (sym); if (name) { @@ -2159,7 +2159,7 @@ gdb_loc (ClientData clientData, Tcl_Inte { char *filename; struct symtab_and_line sal; - char *fname; + const char *fname; CORE_ADDR pc; if (objc == 1) @@ -2919,11 +2919,11 @@ perror_with_name_wrapper (PTR args) If no symbol is found, it returns an empty string. In either case, memory is owned by gdb. Do not attempt to free it. */ -char * +const char * pc_function_name (CORE_ADDR pc) { struct symbol *sym; - char *funcname = NULL; + const char *funcname = NULL; /* First lookup the address in the symbol table... */ sym = find_pc_function (pc); Index: gdbtk/generic/gdbtk-cmds.h =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.h,v retrieving revision 1.5 diff -u -p -r1.5 gdbtk-cmds.h --- gdbtk/generic/gdbtk-cmds.h 23 Dec 2005 18:23:16 -0000 1.5 +++ gdbtk/generic/gdbtk-cmds.h 22 Feb 2012 05:10:55 -0000 @@ -40,7 +40,7 @@ extern int gdbtk_call_wrapper (ClientDat /* Returns the source (demangled) name for a function at PC. Returns empty string if not found. Memory is owned by gdb. Do not free it. */ -extern char *pc_function_name (CORE_ADDR pc); +extern const char *pc_function_name (CORE_ADDR pc); /* Convenience function to sprintf something(s) into a new element in a Tcl list object. */ Index: gdbtk/generic/gdbtk-stack.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v retrieving revision 1.37 diff -u -p -r1.37 gdbtk-stack.c --- gdbtk/generic/gdbtk-stack.c 17 Dec 2011 19:30:39 -0000 1.37 +++ gdbtk/generic/gdbtk-stack.c 22 Feb 2012 05:10:55 -0000 @@ -523,7 +523,7 @@ get_frame_name (Tcl_Interp *interp, Tcl_ { struct symtab_and_line sal; struct symbol *func = NULL; - register char *funname = 0; + const char *funname = 0; enum language funlang = language_unknown; Tcl_Obj *objv[1];