From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59074 invoked by alias); 13 Oct 2015 09:08:02 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 59052 invoked by uid 89); 13 Oct 2015 09:08:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Oct 2015 09:08:00 +0000 Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 13 Oct 2015 11:07:54 +0200 Received: from PENCHT01.corp.atmel.com (10.168.5.161) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 13 Oct 2015 17:07:38 +0800 Received: from PENMBX01.corp.atmel.com ([10.168.5.210]) by PENCHT01.corp.atmel.com ([fe80::95df:d3d0:4452:28e3%12]) with mapi id 14.03.0235.001; Tue, 13 Oct 2015 17:07:53 +0800 From: "Sivanupandi, Pitchumani" To: "gdb@sourceware.org" CC: Andrew Burgess , "tom@tromey.com" , "uweigand@de.ibm.com" Subject: dynamic array's upper bound evaluated as address for AVR target Date: Tue, 13 Oct 2015 09:08:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00060.txt.bz2 Tests from gdb.base/vla-datatypes.exp are failed for AVR target. Test vla-datatypes.c validates size and values of dynamic arrays. When evaluating the array expression (e.g. print int_vla), debug info for upper bound of array read as location expression. By default, the location expressions are treated as DWARF_VALUE_MEMORY (dwarf2expr.c:execute_stack_o= p). and converted to target address (dwarf2loc.c:dwarf2_locexpr_baton_eval). This will lead to incorrect upper bound value for targets like AVR where=20 integer_to_address hook defined. For array 'int_vla', upper bound (e.g. 4) is wrongly converted to avr target sram address (0x80004). And gdb tries to read 0x100008 (0x80004 * 2) bytes of values from array's start address. This is incorrect and caused timeout for avr target. Why is that location expression treated as DWARF_VALUE_MEMORY by default? Can gdb detect if location expression for literal value (e.g. array bounds) or not? Regards, Pitchumani