aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-03-22 21:58:16 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-03-22 21:58:16 +0000
commit8e0662df17dab97387ecb39e95fe0eeab4fcd9e1 (patch)
treef436adb688657daeba0702c296c79ce026809bf1 /gdb/rs6000-tdep.c
parent3121eff097e886c1c47a75abffe574d51adc3958 (diff)
downloadgdb-8e0662df17dab97387ecb39e95fe0eeab4fcd9e1.zip
gdb-8e0662df17dab97387ecb39e95fe0eeab4fcd9e1.tar.gz
gdb-8e0662df17dab97387ecb39e95fe0eeab4fcd9e1.tar.bz2
2002-03-22 Elena Zannoni <ezannoni@redhat.com>
* ppc-linux-tdep.c (ppc_sysv_abi_use_struct_convention): New function. * ppc-tdep.h (ppc_sysv_abi_use_struct_convention): Export. * rs6000-tdep.c (rs6000_gdbarch_init): Use different structure returning convention for SYSV ABI case, but not for GNU/Linux, FreeBSD, or NetBSD.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index ff5a154..9e4d668 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2563,8 +2563,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
- set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
-
set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
@@ -2576,6 +2574,27 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Not sure on this. FIXMEmgo */
set_gdbarch_frame_args_skip (gdbarch, 8);
+ /* Until November 2001, gcc was not complying to the SYSV ABI for
+ returning structures less than or equal to 8 bytes in size. It was
+ returning everything in memory. When this was corrected, it wasn't
+ fixed for native platforms. */
+ if (sysv_abi)
+ {
+ if (osabi == ELFOSABI_LINUX
+ || osabi == ELFOSABI_NETBSD
+ || osabi == ELFOSABI_FREEBSD)
+ set_gdbarch_use_struct_convention (gdbarch,
+ generic_use_struct_convention);
+ else
+ set_gdbarch_use_struct_convention (gdbarch,
+ ppc_sysv_abi_use_struct_convention);
+ }
+ else
+ {
+ set_gdbarch_use_struct_convention (gdbarch,
+ generic_use_struct_convention);
+ }
+
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
if (osabi == ELFOSABI_LINUX)
{