From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27880 invoked by alias); 30 Mar 2010 16:48:44 -0000 Received: (qmail 27869 invoked by uid 22791); 30 Mar 2010 16:48:43 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=BAYES_00,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; Tue, 30 Mar 2010 16:48:39 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2UGmciu003304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Mar 2010 12:48:38 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2UGmYSV008861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 30 Mar 2010 12:48:37 -0400 Message-ID: <4BB22B62.3050402@redhat.com> Date: Wed, 31 Mar 2010 03:20:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc11 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: Hui Zhu CC: insight@sources.redhat.com Subject: Re: undefined reference to `set_breakpoint' References: <4BA11802.8050909@redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090205070609000304050000" 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: 2010-q1/txt/msg00049.txt.bz2 This is a multi-part message in MIME format. --------------090205070609000304050000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 748 On 03/30/2010 01:29 AM, Hui Zhu wrote: > Ping. Did I miss something? > Nope -- I did. After the breakpoint commands API was fiddled with, I worked up the original patch. Some (brief) time after committing my patch, the API was fiddled with again. I apologize about the confusion. Try this patch, which I've committed. Keith ChangeLog 2010-03-30 Keith Seitz * generic/gdbtk-bp.c (gdb_get_breakpoint_info): Breakpoint commands are now reference counted. Adjust data pointers. (gdb_get_tracepoint_info): Likewise. (gdb_actions_command): Don't free previous actions. If the commands aren't valid, we would prefer to keep the old ones any way. break_point_set_commands will also clobber any previous results anyway. --------------090205070609000304050000 Content-Type: text/plain; name="more-bp-cmd-fixes.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="more-bp-cmd-fixes.patch" Content-length: 1678 Index: generic/gdbtk-bp.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v retrieving revision 1.34 diff -u -p -r1.34 gdbtk-bp.c --- generic/gdbtk-bp.c 24 Mar 2010 20:18:28 -0000 1.34 +++ generic/gdbtk-bp.c 30 Mar 2010 16:45:30 -0000 @@ -362,7 +362,7 @@ gdb_get_breakpoint_info (ClientData clie Tcl_NewIntObj (b->ignore_count)); Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - get_breakpoint_commands (b->commands)); + get_breakpoint_commands (b->commands ? b->commands->commands : NULL)); Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (b->cond_string, -1)); @@ -684,9 +684,6 @@ gdb_actions_command (ClientData clientDa return TCL_ERROR; } - /* Free any existing actions. */ - free_command_lines (&tp->commands); - /* Validate and set new tracepoint actions. */ Tcl_ListObjGetElements (interp, objv[2], &gdbtk_obj_array_cnt, &gdbtk_obj_array); @@ -773,12 +770,15 @@ gdb_get_tracepoint_info (ClientData clie /* Append a list of actions */ action_list = Tcl_NewObj (); - for (cl = tp->commands; cl != NULL; cl = cl->next) + if (tp->commands != NULL) { - Tcl_ListObjAppendElement (interp, action_list, - Tcl_NewStringObj (cl->line, -1)); + for (cl = tp->commands->commands; cl != NULL; cl = cl->next) + { + Tcl_ListObjAppendElement (interp, action_list, + Tcl_NewStringObj (cl->line, -1)); + } + Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, action_list); } - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, action_list); return TCL_OK; } --------------090205070609000304050000--