From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] function descriptor handling for push_dummy_call Date: Wed, 19 May 2004 17:05:00 -0000 Message-id: <40AB93DC.5080300@gnu.org> References: <20040518061246.GG566@tausq.org> X-SW-Source: 2004-05/msg00576.html This implements the idea discussed in: http://sources.redhat.com/ml/gdb-patches/2004-05/msg00093.html Instead of passing a dereferenced function value into push_dummy_call (), it passes the entire "struct value *function". This is not a complete patch; it is only for comments. The first bit updates gdbarch.{sh,h,c} with the new prototype, and shows how $(ARCH)-tdep.c will have to change. There are two cases: in most of the cases the func_addr argument in the original prototype is not used, so it is sufficient to only change the function declaration without changing functionality. This will apply to almost all the targets. (hppa-tdep.c is updated as an example.) In a few other cases where the method needs the function address, it will need to either make a call to find_function_addr () or value_as_address (). This includes rs6000-tdep.c, ia64-tdep.c, and possibly other function-descriptor targets. So they could all, as a mechanical operation, be changed from: ..._call (..., CORE_ADDR funaddr, ...) to: ..._call (..., struct value *function, ...) { CORE_ADDR funaddr = find_function_addr (function); (perhaphs make find_function_addr robust to a NULL value_type). I was thinking that infcall.c should convert "function" into a proper function pointer but this appears just as effective. I think this is ok. Andrew