From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19654 invoked by alias); 6 Oct 2011 17:55:22 -0000 Received: (qmail 19641 invoked by uid 22791); 6 Oct 2011 17:55:20 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_CP X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 17:54:59 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RBs9q-0002M2-Fw from pedro_alves@mentor.com ; Thu, 06 Oct 2011 10:54:58 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 6 Oct 2011 18:54:56 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA/RFC] Restore old handling of multi-register variables Date: Thu, 06 Oct 2011 17:55:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Joel Brobecker References: <1317675787-7351-1-git-send-email-brobecker@adacore.com> In-Reply-To: <1317675787-7351-1-git-send-email-brobecker@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110061854.52856.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00169.txt.bz2 Hi Joel. This is a bit a step backwards in that it doesn't allow marking parts of the value as unavailable when the type is longer than one register. get_frame_register_value was invented to allow for partially available registers. > --- a/gdb/findvar.c > +++ b/gdb/findvar.c > @@ -668,9 +668,35 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) > v = gdbarch_value_from_register (gdbarch, type, regnum, frame); > > /* Get the data. */ > - v2 = get_frame_register_value (frame, regnum); > + if (len > register_size (gdbarch, regnum)) > + { I'd rather we get rid of get_frame_register_bytes. That is, pass down a value to get_frame_register_bytes (renaming it along the way) instead of a buffer, and have it do basically the same, but filling the value contents instead of writting to the buffer, and have it mark the value pieces that are unavailable instead of bailing out with error. (May need to pass two different offsets to it, one of register offset, other for value embedded offset, not sure). We could then reimplement get_frame_register_bytes as a wrapper for the new function as an interim until we get rid of get_frame_register_bytes completely. Something like: int get_frame_register_bytes (*type, regnum, offset, len, *myaddr, *optimizedp, *unavailablep) { val = allocate_value (type); read_frame_register_value?(v, frame, regnum, offset, len, val_contents_all_raw (val)); if (value_optimized_out (val)) *optimizedp = 1; if (value_bytes_available (val, offset, len)) *unavailablep = 1; if (!*optimizedp && !*unavailablep) { memcpy (myaddr, val_contents_all_raw (val) + offset, len); return 1; } return 0; } -- Pedro Alves