]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ada-lang.c
[AVR] inferior call of subprogram with pointer as argument
authorJoel Brobecker <brobecker@gnat.com>
Tue, 20 Apr 2010 22:40:36 +0000 (22:40 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 20 Apr 2010 22:40:36 +0000 (22:40 +0000)
commit438c98a1ed6ca9fd9058ad25078f3a9c67d2b7d8
tree2d90b467482ad766581141531ea292efbc0844e1
parent2971b56ba623542a0232473f110922758588fe2c
[AVR] inferior call of subprogram with pointer as argument

On AVR, the gdb view of an address is different from the machine view of the
same address.  We need to use special machinery implemented by value_pointer
to take the pointer of a value.

For instance, considering the following function...

  procedure Trace (Unit    : T; Message : String);

... where T is an access Integer (a pointer to an integer), call to this
function currently triggers the following warnings:

    (gdb) call debug.trace (me, "You")
    warning: Value does not fit in 16 bits.
    warning: Value does not fit in 16 bits.
    Tracing message: You

It could have been worse if Trace actually tried to dereference the Unit
argument...

gdb/ChangeLog (from Tristan Gingold):

* ada-lang.c (value_pointer): New function.
(make_array_descriptor): Call value_pointer to convert addresses to
pointers.

Tested on avr and x86_64-linux.
gdb/ChangeLog
gdb/ada-lang.c