This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit/Ada] result of function call as a parameter to another function call


Hello,

As I hinted a littler earlier, there is a problem in the debugger
where we use a the result from a function call as parameter to another
function call.  The problem arises when the parameter is a reference
type.

Assuming My_Parameter is a variable of type Parameter which is
defined as a record (the equivalent of a C "struct"):

   (gdb) p ident (ident (my_parameter))
   Attempt to take address of value not located in memory.

There were a couple of issues: One was an omission during the
construction of a value (inside ada-lang.c:ensure_lval), where
we forgot to set the value->lval; And another in the handling
of formals that are reference types.

Paul fixed the problem as follow:

2008-01-08  Paul Hilfinger  <hilfinger@adacore.com>

        * ada-lang.c (ensure_lval): Fix value lval kind.
        (convert_actual): Add handling for arguments passed by reference.

I also wrote a testcase:

2008-01-08  Joel Brobecker  <brobecker@adacore.com>

        * gdb.ada/funcall_param: New test program.
        * gdb.ada/funcall_param.exp: New testcase.

Tested on x86-linux, no regression.

I checked the ada-lang.c change in, but I will defer a bit the checkin
of the testcase because the testcase itself depends on another change
that I need to make (Ada parameter coercion, see
http://www.sourceware.org/ml/gdb-patches/2008-01/msg00129.html) in order
to pass.

-- 
Joel

Attachment: ref_args.diff
Description: Text document

Attachment: ref_args-tc.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]