This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] get_frame_name API update


Hi,

A little while ago, I addressed some dangling cleanup issues with get_frame_name by tweaking the API -- the return frame name is now malloc'd, and it is up to the caller to free the memory. The attached patch updates insight.

With this patch, insight can once again be built, but there are still problems. The register window is having some crashing issues which I have yet to investigate.

Keith

ChangeLog
2013-06-05  Keith Seitz  <keiths@redhat.com>

	* generic/gdbtk-stack.c (get_frame_name): Change type of 'funname'
	to char * to follow recent API updates in gdb.
	Free 'funname' after appending it to the list.
	Remove check for NULL funname in a branch where it could only
	ever be NULL.
Index: generic/gdbtk-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v
retrieving revision 1.41
diff -u -p -r1.41 gdbtk-stack.c
--- generic/gdbtk-stack.c	25 May 2012 11:36:08 -0000	1.41
+++ generic/gdbtk-stack.c	5 Jun 2013 19:08:40 -0000
@@ -1,5 +1,5 @@
 /* Tcl/Tk command definitions for Insight - Stack.
-   Copyright (C) 2001-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -524,7 +524,7 @@ static void
 get_frame_name (Tcl_Interp *interp, Tcl_Obj *list, struct frame_info *fi)
 {
   struct symbol *func = NULL;
-  const char *funname = NULL;
+  char *funname = NULL;
   enum language funlang = language_unknown;
   Tcl_Obj *objv[1];
 
@@ -553,6 +553,7 @@ get_frame_name (Tcl_Interp *interp, Tcl_
     {
       objv[0] = Tcl_NewStringObj (funname, -1);
       Tcl_ListObjAppendElement (interp, list, objv[0]);
+      xfree (funname);
     }
   else
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]