public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* dynamic array's upper bound evaluated as address for AVR target
@ 2015-10-13  9:08 Sivanupandi, Pitchumani
  2015-10-13 14:44 ` Pierre-Marie de Rodat
  0 siblings, 1 reply; 13+ messages in thread
From: Sivanupandi, Pitchumani @ 2015-10-13  9:08 UTC (permalink / raw)
  To: gdb; +Cc: Andrew Burgess, tom, uweigand

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-10-23 16:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13  9:08 dynamic array's upper bound evaluated as address for AVR target Sivanupandi, Pitchumani
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

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).