public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Sivanupandi, Pitchumani" <Pitchumani.Sivanupandi@atmel.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>,
	"tom@tromey.com"	<tom@tromey.com>,
	"uweigand@de.ibm.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	[thread overview]
Message-ID: <CAC140656783604CABA6AE60C2A6D5A4A2ED0DE4@penmbx01> (raw)

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_op).
and converted to target address (dwarf2loc.c:dwarf2_locexpr_baton_eval).

This will lead to incorrect upper bound value for targets like AVR where 
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

             reply	other threads:[~2015-10-13  9:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13  9:08 Sivanupandi, Pitchumani [this message]
2015-10-13 14:44 ` Pierre-Marie de Rodat
2015-10-14  6:33   ` Sivanupandi, Pitchumani
2015-10-14  6:54     ` Pierre-Marie de Rodat
2015-10-14  7:54       ` Sivanupandi, Pitchumani
2015-10-14  8:26         ` Pierre-Marie de Rodat
2015-10-14  9:41           ` Ulrich Weigand
2015-10-14 12:26             ` Joel Brobecker
2015-10-14 13:37               ` Pierre-Marie de Rodat
2015-10-23 14:19                 ` Pierre-Marie de Rodat
2015-10-23 16:47                   ` Ulrich Weigand
2015-10-14 10:15           ` Sivanupandi, Pitchumani
2015-10-14 13:39             ` Pierre-Marie de Rodat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC140656783604CABA6AE60C2A6D5A4A2ED0DE4@penmbx01 \
    --to=pitchumani.sivanupandi@atmel.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb@sourceware.org \
    --cc=tom@tromey.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).