From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24498 invoked by alias); 5 Jun 2013 20:31:52 -0000 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 Received: (qmail 24489 invoked by uid 89); 5 Jun 2013 20:31:52 -0000 X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_BT,TW_DB autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 05 Jun 2013 20:31:51 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r55KVoeV019913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Jun 2013 16:31:50 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r55KVnnj017830 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 5 Jun 2013 16:31:50 -0400 Message-ID: <51AFA035.1090506@redhat.com> Date: Wed, 05 Jun 2013 20:31:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: insight Subject: [PATCH] get_frame_name API update Content-Type: multipart/mixed; boundary="------------060607080804060206070202" X-Virus-Found: No X-SW-Source: 2013-q2/txt/msg00017.txt.bz2 This is a multi-part message in MIME format. --------------060607080804060206070202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 707 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 * 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. --------------060607080804060206070202 Content-Type: text/x-patch; name="get_frame_name.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="get_frame_name.patch" Content-length: 1026 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 { --------------060607080804060206070202--