From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16426 invoked by alias); 13 Mar 2014 16:00:58 -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 16407 invoked by uid 89); 13 Mar 2014 16:00:57 -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; Thu, 13 Mar 2014 16:00:56 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2F5271166B7; Thu, 13 Mar 2014 12:00:55 -0400 (EDT) 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 s3tTCqjPKtb4; Thu, 13 Mar 2014 12:00:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0AFAD11668D; Thu, 13 Mar 2014 12:00:54 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id CBBC9E0275; Thu, 13 Mar 2014 09:00:55 -0700 (PDT) Date: Thu, 13 Mar 2014 16:00: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: <20140313160055.GI4882@adacore.com> References: <1391704056-25246-1-git-send-email-sanimir.agovic@intel.com> <1391704056-25246-10-git-send-email-sanimir.agovic@intel.com> <20140228170941.GB16479@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140228170941.GB16479@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-03/txt/msg00317.txt.bz2 > > 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)? I see. It took me a while to understand what you are saying, but I do, now. It's one of these situations where it's almost a shame that some case branches return, while others don't, and fallback on something that happens to take care of dynamicity. Oh well, I have no better proposal at the moment, so the current approach is fine with me. Question for you: Shouldn't we be doing the same for LOC_CONST? Thank you, > > 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 -- Joel