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,RFA:doco] STORE_RETURN_VALUE with regcache


Andrew Cagney <ac131313@ges.redhat.com> writes:

> Hello,
> 
> The attached patch ``upgrades'' STORE_RETURN_VALUE so that it includes 
> the register cache in which the value should be stored (it was using the 
> current global register cache).

Looks good to me.  However, patches like this one break pure
multi-arch targets that are converted to use the non-deprecated
variants of these functions if they don't fill in the deprecated
function in their gdbarch too.

My idea for fixing this is illustrated by the following patch, but
perhaps there is a more elegant way to do this?

Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.155
diff -u -p -r1.155 gdbarch.sh
--- gdbarch.sh 16 Aug 2002 00:27:45 -0000 1.155
+++ gdbarch.sh 20 Aug 2002 18:10:25 -0000
@@ -522,7 +522,7 @@ F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer
 #
 f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
 f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
-f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0
+f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0::gdbarch->extract_return_value == 0 && gdbarch->deprecated_extract_return_value == 0
 f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
 f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
 F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0

> It also makes the buffer parameters ``[const] void *'' which is more 
> like most other architecture methods.

I noticed that you have been introducing bfd_byte in several of your
recent patches.  Why's this better than using char?

Mark


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