coercing arguments to memory in call_function_by_hand

Branko Drevenšek <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.