From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22656 invoked by alias); 13 Jun 2002 02:24:44 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22648 invoked from network); 13 Jun 2002 02:24:40 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 13 Jun 2002 02:24:40 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2923A3CA3; Wed, 12 Jun 2002 22:24:35 -0400 (EDT) Message-ID: <3D080263.1020906@cygnus.com> Date: Wed, 12 Jun 2002 19:24:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0rc3) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Martin M. Hunt" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] bug fixes for varobj.c References: <200206102308.40570.hunt@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-06/txt/msg00207.txt.bz2 > Anything using varobj is randomly corrupting memory and will cause crashes in > Insight or anything using mi varobjs. This patch fixes that and some other > minor problems. Hmm, I'm not seeing MI test failures. Would you, by chance, have something reproduceable for an MI testcase? Anyway, separating out the changes: I consider the sprintf() -> xasprintf() transformations: > (varobj_gen_name): Use xasprintf. > (create_child): Use xasprintf. to be ``obvious'' and can, separatly, go straight in (only ~300 other calls to go ...). The frame_id stuff: > /* Save the selected stack frame, since we will need to change it > in order to evaluate expressions. */ > - old_fi = selected_frame; > + get_frame_id (selected_frame, &old_fid); is fine except I'm not sure about: > - var->root->frame = (CORE_ADDR) -1; > + var->root->frame.base = (CORE_ADDR) -1; > + var->root->frame.pc = (CORE_ADDR) -1; The function: frame_find_by_id (struct frame_id id) has: /* ZERO denotes the null frame, let the caller decide what to do about it. Should it instead return get_current_frame()? */ if (id.base == 0 && id.pc == 0) return NULL; (see find_frame_addr_in_frame_chain for where this came from) so I think zero would be better. For the indentation changes, the way to do this is to (separate patch / commit) run the file through gdb_indent.sh. BTW, the script would not re-indent: -{ - v_public = 0, v_private, v_protected -}; + { + v_public = 0, v_private, v_protected + }; Andrew