From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23975 invoked by alias); 28 Feb 2014 17:09:46 -0000 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 Received: (qmail 23963 invoked by uid 89); 28 Feb 2014 17:09:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 28 Feb 2014 17:09:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 706E9116438; Fri, 28 Feb 2014 12:09:42 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DuXmqqj3kdxt; Fri, 28 Feb 2014 12:09:42 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 36082116429; Fri, 28 Feb 2014 12:09:42 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 571D2E03BD; Fri, 28 Feb 2014 09:09:41 -0800 (PST) Date: Fri, 28 Feb 2014 17:09:00 -0000 From: Joel Brobecker To: Sanimir Agovic Cc: tromey@redhat.com, keven.boell@intel.com, gdb-patches@sourceware.org Subject: Re: [PATCH v5 09/15] vla: resolve dynamic bounds if value contents is a constant byte-sequence Message-ID: <20140228170941.GB16479@adacore.com> References: <1391704056-25246-1-git-send-email-sanimir.agovic@intel.com> <1391704056-25246-10-git-send-email-sanimir.agovic@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391704056-25246-10-git-send-email-sanimir.agovic@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00868.txt.bz2 > A variable location might be a constant value and therefore no inferior memory > access is needed to read the content. In this case try to resolve the type > bounds. > > 2013-11-26 Sanimir Agovic > Keven Boell > > * findvar.c (default_read_var_value): Resolve dynamic bounds if location > points to a constant blob. Would you mind explaining this change a little more; perhaps using some example code would help me understand why we want to resolve dynamic types in this case (and also only in this case)? Thank you, > Signed-off-by: Sanimir Agovic > --- > gdb/findvar.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/findvar.c b/gdb/findvar.c > index ec6afd6..a543dc4 100644 > --- a/gdb/findvar.c > +++ b/gdb/findvar.c > @@ -468,6 +468,9 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) > return v; > > case LOC_CONST_BYTES: > + if (is_dynamic_type (type)) > + /* Value is a constant byte-sequence and needs no memory access. */ > + type = resolve_dynamic_type (type, /* Unused address. */ 0); > v = allocate_value (type); > memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), > TYPE_LENGTH (type)); > -- > 1.8.4.2 -- Joel