From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 912 invoked by alias); 4 Dec 2013 14:21: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 896 invoked by uid 89); 4 Dec 2013 14:21:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_40,KAM_STOCKGEN,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from Unknown (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Dec 2013 14:21:16 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 04 Dec 2013 06:17:27 -0800 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 04 Dec 2013 06:20:48 -0800 Received: from ulliclel004.iul.intel.com (ulliclel004.iul.intel.com [172.28.50.125]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id rB4EKl4R021476; Wed, 4 Dec 2013 14:20:48 GMT Received: from ulliclel004.iul.intel.com (ulliclel004.iul.intel.com [127.0.0.1]) by ulliclel004.iul.intel.com (8.13.8/8.12.8/MailSET/client) with ESMTP id rB4EKkYW015819; Wed, 4 Dec 2013 15:20:46 +0100 Received: (from sagovic@localhost) by ulliclel004.iul.intel.com (8.13.8/8.13.1/Submit) id rB4EKfZ6015818; Wed, 4 Dec 2013 15:20:41 +0100 From: Sanimir Agovic To: tromey@redhat.com, palves@redhat.com, xdje42@gmail.com Cc: gdb-patches@sourceware.org, keven.boell@intel.com Subject: [PATCH v3 08/13] vla: resolve dynamic bounds if value contents is a constant byte-sequence Date: Wed, 04 Dec 2013 14:21:00 -0000 Message-Id: <1386166785-28037-10-git-send-email-sanimir.agovic@intel.com> In-Reply-To: <1386166785-28037-1-git-send-email-sanimir.agovic@intel.com> References: <1386166785-28037-1-git-send-email-sanimir.agovic@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00133.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. Change-Id: I73c31b64976b7d2c603c68d4584909502c8c5928 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.3.1