This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [patch/rfc] function descriptor handling for push_dummy_call


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



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