From: Andrew Cagney Date: Wed, 7 Nov 2001 22:42:29 +0000 (+0000) Subject: gdbarch.sh provides default for USE_STRUCT_CONVENTION. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56f127518feeed8b7576b176a0d3b0f4ff3d7ca1;p=binutils-gdb.git gdbarch.sh provides default for USE_STRUCT_CONVENTION. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5123cfdf0da..0cd341ddafd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2001-11-07 Andrew Cagney + + * gdbarch.sh (USE_STRUCT_CONVENTION): Default to + generic_use_struct_convention. + * gdbarch.h, gdbarch.c: Regenerate. + * values.c (USE_STRUCT_CONVENTION): Delete definition, moved to + gdbarch.h. + 2001-11-06 Andrew Cagney * gdbarch.sh (PC_IN_CALL_DUMMY): Require a value. diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 65d18d23fd9..ee4512eda62 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -486,6 +486,7 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->pointer_to_address = unsigned_pointer_to_address; current_gdbarch->address_to_pointer = unsigned_address_to_pointer; current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not; + current_gdbarch->use_struct_convention = generic_use_struct_convention; current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; @@ -689,9 +690,7 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->store_return_value == 0)) fprintf_unfiltered (log, "\n\tstore_return_value"); /* Skip verify of extract_struct_value_address, has predicate */ - if ((GDB_MULTI_ARCH >= 2) - && (gdbarch->use_struct_convention == 0)) - fprintf_unfiltered (log, "\n\tuse_struct_convention"); + /* Skip verify of use_struct_convention, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_init_saved_regs == 0)) fprintf_unfiltered (log, "\n\tframe_init_saved_regs"); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 2ed6b2143ea..c639476aa76 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1442,6 +1442,11 @@ extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, g #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION) +#define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type)) +#endif + typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 85e94af0821..e469460d9e5 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -484,7 +484,7 @@ f:2:POP_FRAME:void:pop_frame:void:-:::0 f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0 F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0 -f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0 +f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0 # f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0 F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0 diff --git a/gdb/values.c b/gdb/values.c index eedeaf96057..639f7bf4081 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -1382,11 +1382,6 @@ generic_use_struct_convention (int gcc_p, struct type *value_type) || TYPE_LENGTH (value_type) == 8)); } -#ifndef USE_STRUCT_CONVENTION -#define USE_STRUCT_CONVENTION(gcc_p,type) generic_use_struct_convention (gcc_p, type) -#endif - - /* Return true if the function specified is using the structure returning convention on this machine to return arguments, or 0 if it is using the value returning convention. FUNCTION is the value representing