public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: insight <insight@sourceware.org>
Subject: [PATCH] get_frame_name API update
Date: Wed, 05 Jun 2013 20:31:00 -0000	[thread overview]
Message-ID: <51AFA035.1090506@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

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.

[-- Attachment #2: get_frame_name.patch --]
[-- Type: text/x-patch, Size: 1026 bytes --]

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
     {

                 reply	other threads:[~2013-06-05 20:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AFA035.1090506@redhat.com \
    --to=keiths@redhat.com \
    --cc=insight@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).