This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
coercing arguments to memory in call_function_by_hand
- From: Branko DrevenÅek <branko dot drevensek at gmail dot com>
- To: gdb at sourceware dot org
- Date: Fri, 12 Dec 2014 17:46:46 +0100
- Subject: coercing arguments to memory in call_function_by_hand
- Authentication-results: sourceware.org; auth=none
Hi,
I'm implementing push_dummy_call for a target that requires struct&union
arguments to be passed in registers if they are smaller than two
registers (which works ok), but requires address of struct or union to
be passed instead for if argument is larger that two registers.
Problem with this is that call_function_by_hand calls value_arg_coerce
for all arguments of called function, which in fact decides which
arguments it needs to coerce to target memory based on some rules, which
don't take into account ABI requirements. This means big struct
arguments for example are not coerced to target and appropriate pointer
can not be passed.
I do another round of checks and ~duplicate code from
value_coerce_to_target, but is there/should there be a better way?
Should something be done about it (I can try to prepare a patch) or
should I just keep duplicate the code and forget about it?
Having architecture specific value_must_coerce_to_target (or similar)
would make this simpler.
BR.
Branko Drevensek