public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [RFA] GDB API Updates
@ 2012-02-22  5:29 Kevin Buettner
  2012-02-28 17:22 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2012-02-22  5:29 UTC (permalink / raw)
  To: insight

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];
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] GDB API Updates
  2012-02-22  5:29 [RFA] GDB API Updates Kevin Buettner
@ 2012-02-28 17:22 ` Keith Seitz
  2012-02-28 21:53   ` Kevin Buettner
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2012-02-28 17:22 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: insight

On 02/21/2012 09:29 PM, Kevin Buettner wrote:
> 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?

I apologize for the delay. Please commit your patch. Thank you for 
noticing this! I've been so busy with my own work that I haven't even 
tried to build insight in the last month.

Keith


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] GDB API Updates
  2012-02-28 17:22 ` Keith Seitz
@ 2012-02-28 21:53   ` Kevin Buettner
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2012-02-28 21:53 UTC (permalink / raw)
  To: insight

On Tue, 28 Feb 2012 09:22:09 -0800
Keith Seitz <keiths@redhat.com> wrote:

> Please commit your patch. [...]

Committed.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-28 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22  5:29 [RFA] GDB API Updates Kevin Buettner
2012-02-28 17:22 ` Keith Seitz
2012-02-28 21:53   ` Kevin Buettner

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).