From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17251 invoked by alias); 29 Apr 2010 21:01:08 -0000 Received: (qmail 17144 invoked by uid 22791); 29 Apr 2010 21:01:06 -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; Thu, 29 Apr 2010 21:01:02 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3TL10jt003397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Apr 2010 17:01:00 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3TL0tqL016796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 29 Apr 2010 17:00:59 -0400 Message-ID: <4BD9F387.7020108@redhat.com> Date: Thu, 29 Apr 2010 21:01:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: insight Subject: [PATCH] Fix insight/347 (watch win crash) Content-Type: multipart/mixed; boundary="------------070802020008060105020902" 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-q2/txt/msg00008.txt.bz2 This is a multi-part message in MIME format. --------------070802020008060105020902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 428 Hi, I've committed the attached patch which fixes some API changes in varobj_set_value that I missed (a looooong time ago). Keith ChangeLog 2010-04-29 Keith Seitz insight/347 * generic/gdbtk-varobj.c (variable_value): Use TRY_CATCH when calling varobj_set_value. * library/vartree.itb (changeValue): Make note of new assumption that input is decimal (unless prefixed to change the input radix). --------------070802020008060105020902 Content-Type: text/plain; name="vartree-changeValue-crash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vartree-changeValue-crash.patch" Content-length: 2483 Index: generic/gdbtk-varobj.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v retrieving revision 1.25 diff -u -p -r1.25 gdbtk-varobj.c --- generic/gdbtk-varobj.c 17 Sep 2009 07:00:48 -0000 1.25 +++ generic/gdbtk-varobj.c 29 Apr 2010 20:57:25 -0000 @@ -1,5 +1,6 @@ /* Variable user interface layer for GDB, the GNU debugger. - Copyright (C) 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2008, 2010 + Free Software Foundation, Inc. This file is part of GDB. @@ -22,6 +23,7 @@ #include "value.h" #include "gdb_string.h" #include "varobj.h" +#include "exceptions.h" #include #include "gdbtk.h" @@ -574,9 +576,16 @@ variable_value (Tcl_Interp *interp, int if (varobj_get_attributes (var) & 0x00000001 /* Editable? */ ) { char *s; + int ok = 0; + struct gdb_exception e; s = Tcl_GetStringFromObj (objv[2], NULL); - if (!varobj_set_value (var, s)) + TRY_CATCH (e, RETURN_MASK_ERROR) + { + ok = varobj_set_value (var, s); + } + + if (e.reason < 0 || !ok) { gdbtk_set_result (interp, "Could not assign expression to variable object"); return TCL_ERROR; Index: library/vartree.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/vartree.itb,v retrieving revision 1.8 diff -u -p -r1.8 vartree.itb --- library/vartree.itb 24 Apr 2009 03:38:49 -0000 1.8 +++ library/vartree.itb 29 Apr 2010 20:57:25 -0000 @@ -1,5 +1,5 @@ # Variable tree implementation for Insight. -# Copyright (C) 2002, 2009 Red Hat, Inc. +# Copyright (C) 2002, 2009, 2010 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License (GPL) as published by @@ -286,6 +286,14 @@ itcl::body VarTree::changeValue {j} { unedit $j return } + + # NOTE: Varobj requires decimal input radix. So either + # we must assume that all input is decimal (unless prefixed by + # "0x"), or we assume that the input radix is the same as the + # variable's display radix. + # + # I think that consistency wins out over convenience here. We will + # require users to prefix non-decimal expressions. if {[catch {$entryobj value $new} errTxt]} { # gdbtk-varobj doesn't actually return meaningful error messages # so use a generic one. --------------070802020008060105020902--