This is the mail archive of the gdb@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]

coercing arguments to memory in call_function_by_hand


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



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