2002-05-30 03:21:53 +02:00
|
|
|
/* Target-dependent code for PowerPC systems using the SVR4 ABI
|
|
|
|
for GDB, the GNU debugger.
|
|
|
|
|
2014-01-01 04:54:24 +01:00
|
|
|
Copyright (C) 2000-2014 Free Software Foundation, Inc.
|
2002-05-30 03:21:53 +02:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-05-30 03:21:53 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-05-30 03:21:53 +02:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "gdbcore.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "regcache.h"
|
|
|
|
#include "value.h"
|
remove gdb_string.h
This removes gdb_string.h. This patch is purely mechanical. I
created it by running the two commands:
git rm common/gdb_string.h
perl -pi -e's/"gdb_string.h"/<string.h>/;' *.[chyl] */*.[chyl]
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_string.h: Remove.
* aarch64-tdep.c: Use string.h, not gdb_string.h.
* ada-exp.y: Use string.h, not gdb_string.h.
* ada-lang.c: Use string.h, not gdb_string.h.
* ada-lex.l: Use string.h, not gdb_string.h.
* ada-typeprint.c: Use string.h, not gdb_string.h.
* ada-valprint.c: Use string.h, not gdb_string.h.
* aix-thread.c: Use string.h, not gdb_string.h.
* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
* alpha-nat.c: Use string.h, not gdb_string.h.
* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
* alpha-tdep.c: Use string.h, not gdb_string.h.
* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
* amd64-linux-nat.c: Use string.h, not gdb_string.h.
* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
* amd64-nat.c: Use string.h, not gdb_string.h.
* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
* arch-utils.c: Use string.h, not gdb_string.h.
* arm-linux-nat.c: Use string.h, not gdb_string.h.
* arm-linux-tdep.c: Use string.h, not gdb_string.h.
* arm-tdep.c: Use string.h, not gdb_string.h.
* arm-wince-tdep.c: Use string.h, not gdb_string.h.
* armbsd-tdep.c: Use string.h, not gdb_string.h.
* armnbsd-nat.c: Use string.h, not gdb_string.h.
* armnbsd-tdep.c: Use string.h, not gdb_string.h.
* armobsd-tdep.c: Use string.h, not gdb_string.h.
* avr-tdep.c: Use string.h, not gdb_string.h.
* ax-gdb.c: Use string.h, not gdb_string.h.
* ax-general.c: Use string.h, not gdb_string.h.
* bcache.c: Use string.h, not gdb_string.h.
* bfin-tdep.c: Use string.h, not gdb_string.h.
* breakpoint.c: Use string.h, not gdb_string.h.
* build-id.c: Use string.h, not gdb_string.h.
* buildsym.c: Use string.h, not gdb_string.h.
* c-exp.y: Use string.h, not gdb_string.h.
* c-lang.c: Use string.h, not gdb_string.h.
* c-typeprint.c: Use string.h, not gdb_string.h.
* c-valprint.c: Use string.h, not gdb_string.h.
* charset.c: Use string.h, not gdb_string.h.
* cli-out.c: Use string.h, not gdb_string.h.
* cli/cli-cmds.c: Use string.h, not gdb_string.h.
* cli/cli-decode.c: Use string.h, not gdb_string.h.
* cli/cli-dump.c: Use string.h, not gdb_string.h.
* cli/cli-interp.c: Use string.h, not gdb_string.h.
* cli/cli-logging.c: Use string.h, not gdb_string.h.
* cli/cli-script.c: Use string.h, not gdb_string.h.
* cli/cli-setshow.c: Use string.h, not gdb_string.h.
* cli/cli-utils.c: Use string.h, not gdb_string.h.
* coffread.c: Use string.h, not gdb_string.h.
* common/common-utils.c: Use string.h, not gdb_string.h.
* common/filestuff.c: Use string.h, not gdb_string.h.
* common/linux-procfs.c: Use string.h, not gdb_string.h.
* common/linux-ptrace.c: Use string.h, not gdb_string.h.
* common/signals.c: Use string.h, not gdb_string.h.
* common/vec.h: Use string.h, not gdb_string.h.
* core-regset.c: Use string.h, not gdb_string.h.
* corefile.c: Use string.h, not gdb_string.h.
* corelow.c: Use string.h, not gdb_string.h.
* cp-abi.c: Use string.h, not gdb_string.h.
* cp-support.c: Use string.h, not gdb_string.h.
* cp-valprint.c: Use string.h, not gdb_string.h.
* cris-tdep.c: Use string.h, not gdb_string.h.
* d-lang.c: Use string.h, not gdb_string.h.
* dbxread.c: Use string.h, not gdb_string.h.
* dcache.c: Use string.h, not gdb_string.h.
* demangle.c: Use string.h, not gdb_string.h.
* dicos-tdep.c: Use string.h, not gdb_string.h.
* disasm.c: Use string.h, not gdb_string.h.
* doublest.c: Use string.h, not gdb_string.h.
* dsrec.c: Use string.h, not gdb_string.h.
* dummy-frame.c: Use string.h, not gdb_string.h.
* dwarf2-frame.c: Use string.h, not gdb_string.h.
* dwarf2loc.c: Use string.h, not gdb_string.h.
* dwarf2read.c: Use string.h, not gdb_string.h.
* elfread.c: Use string.h, not gdb_string.h.
* environ.c: Use string.h, not gdb_string.h.
* eval.c: Use string.h, not gdb_string.h.
* event-loop.c: Use string.h, not gdb_string.h.
* exceptions.c: Use string.h, not gdb_string.h.
* exec.c: Use string.h, not gdb_string.h.
* expprint.c: Use string.h, not gdb_string.h.
* f-exp.y: Use string.h, not gdb_string.h.
* f-lang.c: Use string.h, not gdb_string.h.
* f-typeprint.c: Use string.h, not gdb_string.h.
* f-valprint.c: Use string.h, not gdb_string.h.
* fbsd-nat.c: Use string.h, not gdb_string.h.
* findcmd.c: Use string.h, not gdb_string.h.
* findvar.c: Use string.h, not gdb_string.h.
* fork-child.c: Use string.h, not gdb_string.h.
* frame.c: Use string.h, not gdb_string.h.
* frv-linux-tdep.c: Use string.h, not gdb_string.h.
* frv-tdep.c: Use string.h, not gdb_string.h.
* gdb.c: Use string.h, not gdb_string.h.
* gdb_bfd.c: Use string.h, not gdb_string.h.
* gdbarch.c: Use string.h, not gdb_string.h.
* gdbtypes.c: Use string.h, not gdb_string.h.
* gnu-nat.c: Use string.h, not gdb_string.h.
* gnu-v2-abi.c: Use string.h, not gdb_string.h.
* gnu-v3-abi.c: Use string.h, not gdb_string.h.
* go-exp.y: Use string.h, not gdb_string.h.
* go-lang.c: Use string.h, not gdb_string.h.
* go32-nat.c: Use string.h, not gdb_string.h.
* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
* hppa-linux-nat.c: Use string.h, not gdb_string.h.
* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
* i386-linux-nat.c: Use string.h, not gdb_string.h.
* i386-linux-tdep.c: Use string.h, not gdb_string.h.
* i386-nto-tdep.c: Use string.h, not gdb_string.h.
* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
* i386-tdep.c: Use string.h, not gdb_string.h.
* i386bsd-tdep.c: Use string.h, not gdb_string.h.
* i386gnu-nat.c: Use string.h, not gdb_string.h.
* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
* i386obsd-tdep.c: Use string.h, not gdb_string.h.
* i387-tdep.c: Use string.h, not gdb_string.h.
* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
* ia64-linux-nat.c: Use string.h, not gdb_string.h.
* inf-child.c: Use string.h, not gdb_string.h.
* inf-ptrace.c: Use string.h, not gdb_string.h.
* inf-ttrace.c: Use string.h, not gdb_string.h.
* infcall.c: Use string.h, not gdb_string.h.
* infcmd.c: Use string.h, not gdb_string.h.
* inflow.c: Use string.h, not gdb_string.h.
* infrun.c: Use string.h, not gdb_string.h.
* interps.c: Use string.h, not gdb_string.h.
* iq2000-tdep.c: Use string.h, not gdb_string.h.
* irix5-nat.c: Use string.h, not gdb_string.h.
* jv-exp.y: Use string.h, not gdb_string.h.
* jv-lang.c: Use string.h, not gdb_string.h.
* jv-typeprint.c: Use string.h, not gdb_string.h.
* jv-valprint.c: Use string.h, not gdb_string.h.
* language.c: Use string.h, not gdb_string.h.
* linux-fork.c: Use string.h, not gdb_string.h.
* linux-nat.c: Use string.h, not gdb_string.h.
* lm32-tdep.c: Use string.h, not gdb_string.h.
* m2-exp.y: Use string.h, not gdb_string.h.
* m2-typeprint.c: Use string.h, not gdb_string.h.
* m32c-tdep.c: Use string.h, not gdb_string.h.
* m32r-linux-nat.c: Use string.h, not gdb_string.h.
* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
* m32r-rom.c: Use string.h, not gdb_string.h.
* m32r-tdep.c: Use string.h, not gdb_string.h.
* m68hc11-tdep.c: Use string.h, not gdb_string.h.
* m68k-tdep.c: Use string.h, not gdb_string.h.
* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
* m68klinux-nat.c: Use string.h, not gdb_string.h.
* m68klinux-tdep.c: Use string.h, not gdb_string.h.
* m88k-tdep.c: Use string.h, not gdb_string.h.
* macrocmd.c: Use string.h, not gdb_string.h.
* main.c: Use string.h, not gdb_string.h.
* mdebugread.c: Use string.h, not gdb_string.h.
* mem-break.c: Use string.h, not gdb_string.h.
* memattr.c: Use string.h, not gdb_string.h.
* memory-map.c: Use string.h, not gdb_string.h.
* mep-tdep.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
* mi/mi-cmds.c: Use string.h, not gdb_string.h.
* mi/mi-console.c: Use string.h, not gdb_string.h.
* mi/mi-getopt.c: Use string.h, not gdb_string.h.
* mi/mi-interp.c: Use string.h, not gdb_string.h.
* mi/mi-main.c: Use string.h, not gdb_string.h.
* mi/mi-parse.c: Use string.h, not gdb_string.h.
* microblaze-rom.c: Use string.h, not gdb_string.h.
* microblaze-tdep.c: Use string.h, not gdb_string.h.
* mingw-hdep.c: Use string.h, not gdb_string.h.
* minidebug.c: Use string.h, not gdb_string.h.
* minsyms.c: Use string.h, not gdb_string.h.
* mips-irix-tdep.c: Use string.h, not gdb_string.h.
* mips-linux-tdep.c: Use string.h, not gdb_string.h.
* mips-tdep.c: Use string.h, not gdb_string.h.
* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
* mipsread.c: Use string.h, not gdb_string.h.
* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
* mn10300-tdep.c: Use string.h, not gdb_string.h.
* monitor.c: Use string.h, not gdb_string.h.
* moxie-tdep.c: Use string.h, not gdb_string.h.
* mt-tdep.c: Use string.h, not gdb_string.h.
* nbsd-tdep.c: Use string.h, not gdb_string.h.
* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
* nto-procfs.c: Use string.h, not gdb_string.h.
* nto-tdep.c: Use string.h, not gdb_string.h.
* objc-lang.c: Use string.h, not gdb_string.h.
* objfiles.c: Use string.h, not gdb_string.h.
* opencl-lang.c: Use string.h, not gdb_string.h.
* osabi.c: Use string.h, not gdb_string.h.
* osdata.c: Use string.h, not gdb_string.h.
* p-exp.y: Use string.h, not gdb_string.h.
* p-lang.c: Use string.h, not gdb_string.h.
* p-typeprint.c: Use string.h, not gdb_string.h.
* parse.c: Use string.h, not gdb_string.h.
* posix-hdep.c: Use string.h, not gdb_string.h.
* ppc-linux-nat.c: Use string.h, not gdb_string.h.
* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
* printcmd.c: Use string.h, not gdb_string.h.
* procfs.c: Use string.h, not gdb_string.h.
* prologue-value.c: Use string.h, not gdb_string.h.
* python/py-auto-load.c: Use string.h, not gdb_string.h.
* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
* ravenscar-thread.c: Use string.h, not gdb_string.h.
* regcache.c: Use string.h, not gdb_string.h.
* registry.c: Use string.h, not gdb_string.h.
* remote-fileio.c: Use string.h, not gdb_string.h.
* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
* remote-mips.c: Use string.h, not gdb_string.h.
* remote-sim.c: Use string.h, not gdb_string.h.
* remote.c: Use string.h, not gdb_string.h.
* reverse.c: Use string.h, not gdb_string.h.
* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
* ser-base.c: Use string.h, not gdb_string.h.
* ser-go32.c: Use string.h, not gdb_string.h.
* ser-mingw.c: Use string.h, not gdb_string.h.
* ser-pipe.c: Use string.h, not gdb_string.h.
* ser-tcp.c: Use string.h, not gdb_string.h.
* ser-unix.c: Use string.h, not gdb_string.h.
* serial.c: Use string.h, not gdb_string.h.
* sh-tdep.c: Use string.h, not gdb_string.h.
* sh64-tdep.c: Use string.h, not gdb_string.h.
* shnbsd-tdep.c: Use string.h, not gdb_string.h.
* skip.c: Use string.h, not gdb_string.h.
* sol-thread.c: Use string.h, not gdb_string.h.
* solib-dsbt.c: Use string.h, not gdb_string.h.
* solib-frv.c: Use string.h, not gdb_string.h.
* solib-osf.c: Use string.h, not gdb_string.h.
* solib-spu.c: Use string.h, not gdb_string.h.
* solib-target.c: Use string.h, not gdb_string.h.
* solib.c: Use string.h, not gdb_string.h.
* somread.c: Use string.h, not gdb_string.h.
* source.c: Use string.h, not gdb_string.h.
* sparc-nat.c: Use string.h, not gdb_string.h.
* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
* sparc-tdep.c: Use string.h, not gdb_string.h.
* sparc64-tdep.c: Use string.h, not gdb_string.h.
* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
* spu-linux-nat.c: Use string.h, not gdb_string.h.
* spu-multiarch.c: Use string.h, not gdb_string.h.
* spu-tdep.c: Use string.h, not gdb_string.h.
* stabsread.c: Use string.h, not gdb_string.h.
* stack.c: Use string.h, not gdb_string.h.
* std-regs.c: Use string.h, not gdb_string.h.
* symfile.c: Use string.h, not gdb_string.h.
* symmisc.c: Use string.h, not gdb_string.h.
* symtab.c: Use string.h, not gdb_string.h.
* target.c: Use string.h, not gdb_string.h.
* thread.c: Use string.h, not gdb_string.h.
* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
* tilegx-tdep.c: Use string.h, not gdb_string.h.
* top.c: Use string.h, not gdb_string.h.
* tracepoint.c: Use string.h, not gdb_string.h.
* tui/tui-command.c: Use string.h, not gdb_string.h.
* tui/tui-data.c: Use string.h, not gdb_string.h.
* tui/tui-disasm.c: Use string.h, not gdb_string.h.
* tui/tui-file.c: Use string.h, not gdb_string.h.
* tui/tui-layout.c: Use string.h, not gdb_string.h.
* tui/tui-out.c: Use string.h, not gdb_string.h.
* tui/tui-regs.c: Use string.h, not gdb_string.h.
* tui/tui-source.c: Use string.h, not gdb_string.h.
* tui/tui-stack.c: Use string.h, not gdb_string.h.
* tui/tui-win.c: Use string.h, not gdb_string.h.
* tui/tui-windata.c: Use string.h, not gdb_string.h.
* tui/tui-winsource.c: Use string.h, not gdb_string.h.
* typeprint.c: Use string.h, not gdb_string.h.
* ui-file.c: Use string.h, not gdb_string.h.
* ui-out.c: Use string.h, not gdb_string.h.
* user-regs.c: Use string.h, not gdb_string.h.
* utils.c: Use string.h, not gdb_string.h.
* v850-tdep.c: Use string.h, not gdb_string.h.
* valarith.c: Use string.h, not gdb_string.h.
* valops.c: Use string.h, not gdb_string.h.
* valprint.c: Use string.h, not gdb_string.h.
* value.c: Use string.h, not gdb_string.h.
* varobj.c: Use string.h, not gdb_string.h.
* vax-tdep.c: Use string.h, not gdb_string.h.
* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
* windows-nat.c: Use string.h, not gdb_string.h.
* xcoffread.c: Use string.h, not gdb_string.h.
* xml-support.c: Use string.h, not gdb_string.h.
* xstormy16-tdep.c: Use string.h, not gdb_string.h.
* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
2013-11-06 15:14:23 +01:00
|
|
|
#include <string.h>
|
2003-10-10 20:29:13 +02:00
|
|
|
#include "gdb_assert.h"
|
2002-05-30 03:21:53 +02:00
|
|
|
#include "ppc-tdep.h"
|
2003-10-31 17:37:03 +01:00
|
|
|
#include "target.h"
|
2003-11-14 15:34:30 +01:00
|
|
|
#include "objfiles.h"
|
2004-06-07 04:02:55 +02:00
|
|
|
#include "infcall.h"
|
2011-02-08 14:30:10 +01:00
|
|
|
#include "dwarf2.h"
|
2002-05-30 03:21:53 +02:00
|
|
|
|
2011-10-26 19:21:53 +02:00
|
|
|
|
|
|
|
/* Check whether FTPYE is a (pointer to) function type that should use
|
|
|
|
the OpenCL vector ABI. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
ppc_sysv_use_opencl_abi (struct type *ftype)
|
|
|
|
{
|
|
|
|
ftype = check_typedef (ftype);
|
|
|
|
|
|
|
|
if (TYPE_CODE (ftype) == TYPE_CODE_PTR)
|
|
|
|
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
|
|
|
|
|
|
|
|
return (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|
|
|
|
&& TYPE_CALLING_CONVENTION (ftype) == DW_CC_GDB_IBM_OpenCL);
|
|
|
|
}
|
|
|
|
|
2011-01-10 21:38:51 +01:00
|
|
|
/* Pass the arguments in either registers, or in the stack. Using the
|
2002-05-30 03:21:53 +02:00
|
|
|
ppc sysv ABI, the first eight words of the argument list (that might
|
|
|
|
be less than eight parameters if some parameters occupy more than one
|
|
|
|
word) are passed in r3..r10 registers. float and double parameters are
|
2011-01-10 21:38:51 +01:00
|
|
|
passed in fpr's, in addition to that. Rest of the parameters if any
|
|
|
|
are passed in user stack.
|
2002-05-30 03:21:53 +02:00
|
|
|
|
|
|
|
If the function is returning a structure, then the return address is passed
|
|
|
|
in r3, then the first 7 words of the parametes can be passed in registers,
|
2011-01-10 21:38:51 +01:00
|
|
|
starting from r4. */
|
2002-05-30 03:21:53 +02:00
|
|
|
|
|
|
|
CORE_ADDR
|
2004-06-07 04:02:55 +02:00
|
|
|
ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
2003-09-09 20:29:27 +02:00
|
|
|
struct regcache *regcache, CORE_ADDR bp_addr,
|
|
|
|
int nargs, struct value **args, CORE_ADDR sp,
|
|
|
|
int struct_return, CORE_ADDR struct_addr)
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
2011-10-26 19:21:53 +02:00
|
|
|
int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
|
2007-05-13 14:27:30 +02:00
|
|
|
ULONGEST saved_sp;
|
2003-09-12 20:55:24 +02:00
|
|
|
int argspace = 0; /* 0 is an initial wrong guess. */
|
|
|
|
int write_pass;
|
2002-05-30 03:21:53 +02:00
|
|
|
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
gdb_assert (tdep->wordsize == 4);
|
|
|
|
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
regcache_cooked_read_unsigned (regcache, gdbarch_sp_regnum (gdbarch),
|
2007-06-18 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (SP_REGNUM): Replace by gdbarch_sp_regnum.
* v850-tdep.c (v850_unwind_sp): Likewise.
* std-regs.c (value_of_builtin_frame_sp_reg): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh-tdep.c (sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu)
(sh_dwarf2_frame_init_reg, sh_frame_cache, sh_frame_prev_register)
(sh_unwind_sp): Likewise.
* sh64-tdep.c (sh64_push_dummy_call, sh64_frame_cache)
(sh64_frame_prev_register, sh64_unwind_sp): Likewise.
* rs6000-tdep.c (rs6000_push_dummy_call, rs6000_unwind_dummy_id)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (store_register): Likewise.
* remote-mips.c (mips_wait): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* m32r-rom.c (m32r_supply_register): Likewise.
* frame.c (frame_sp_unwind): Likewise.
* mips-tdep.c (mips_insn16_frame_cache)
(mips_insn32_frame_cache): Likewise (comment).
* m68klinux-nat.c (supply_gregset): Likewise.
* m68k-tdep.c (m68k_get_longjmp_target): Likewise.
* ia64-tdep.c (ia64_frame_prev_register): Likewise.
* i386-tdep.c (i386_get_longjmp_target): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* cris-tdep.c (cris_regnums, cris_sigcontext_addr)
(cris_sigtramp_frame_unwind_cache, cris_push_dummy_call)
(cris_scan_prologue, crisv32_scan_prologue, cris_unwind_sp)
(cris_register_type, crisv32_register_type)
(cris_dwarf2_frame_init_reg): Likewise.
* arch-utils.c (legacy_virtual_frame_pointer): Likewise.
* amd64-tdep.c (amd64_frame_prev_register): Likewise.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise.
* libunwind-frame.c (libunwind_frame_cache): Likewise.
* gdbarch.sh (PC_REGNUM): Replace by gdbarch_pc_regnum.
* regcache.c (read_pc_pid, generic_target_write_pc): Likewise.
* xtensa-tdep.c (xtensa_register_type, xtensa_supply_gregset)
(xtensa_unwind_pc, xtensa_frame_cache, xtensa_frame_prev_register)
(xtensa_extract_return_value, xtensa_store_return_value): Likewise.
* v850-tdep.c (v850_unwind_pc): Likewise.
* stack.c (frame_info): Likewise.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs)
(sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs)
(sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs)
(sh_dwarf2_frame_init_reg, sh_frame_prev_register, sh_unwind_pc)
(sh_dsp_show_regs): Likewise.
* shnbsd-tdep.c (shnbsd_supply_gregset)
(shnbsd_collect_gregset): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Likewise.
* sh64-tdep.c (sh64_compact_reg_base_num, sh64_show_media_regs)
(sh64_frame_prev_register, sh64_unwind_pc): Likewise.
* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset)
(6000_register_reggroup_p, rs6000_unwind_pc)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (regmap, rs6000_fetch_inferior_registers)
(rs6000_store_inferior_registers): Likewise.
* remote-mips.c (mips_wait, mips_load): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcnbsd-nat.c (getregs_supplies, ppcnbsd_supply_pcb): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_ppc_registers)
(store_ppc_registers, fill_gregset): Likewise.
* mips-tdep.c (mips_stub_frame_cache, mips_gdbarch_init): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_fill_reg): Likewise.
* mipsnbsd-nat.c (getregs_supplies): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* irix5-nat.c (fill_gregset): Likewise.
* i386-tdep.c (i386_unwind_pc): Likewise.
* i386-linux-nat.c (i386_linux_resume): Likewise.
* frame.c (get_prev_frame_1): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* dbug-rom.c (dbug_supply_register): Likewise.
* cris-tdep.c (cris_sigtramp_frame_unwind_cache, cris_scan_prologue)
(crisv32_scan_prologue, cris_unwind_pc, cris_register_size)
(cris_register_type, crisv32_register_type, crisv32_register_name)
(cris_dwarf2_frame_init_reg, find_step_target)
(cris_software_single_step, cris_supply_gregset)
(cris_regnums): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* aix-thread.c (special_register_p, supply_sprs64, supply_sprs32)
(fill_sprs64, fill_sprs32, store_regs_user_thread): Likewise.
* mips-linux-tdep.c (mips_linux_write_pc): Likewise.
* gdbarch.sh (PS_REGNUM): Replace by gdbarch_ps_regnum.
* dbug-rom.c (dbug_supply_register): Likewise.
* xtensa-tdep.c (xtensa_supply_gregset, xtensa_frame_cache)
(xtensa_frame_prev_register, xtensa_push_dummy_call): Likewise.
* win32-nat.c (win32_resume): Likewise.
* std-regs.c (value_of_builtin_frame_ps_reg)
(value_of_builtin_frame_pc_reg): Likewise.
* m68k-tdep.c (m68k_register_type): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* gdbarch.sh (FP0_REGNUM): Replace by gdbarch_fp0_regnum.
* sh-tdep.c (sh_extract_return_value_fpu, sh_store_return_value_fpu)
(sh2e_show_regs, sh2a_show_regs, sh3e_show_regs, sh4_show_regs)
(sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_register_type)
(fv_reg_base_num, dr_reg_base_num): Likewise.
* sh64-tdep.c (sh64_fv_reg_base_num, sh64_dr_reg_base_num)
(sh64_fpp_reg_base_num, sh64_compact_reg_base_num, sh64_push_dummy_call)
(sh64_extract_return_value, sh64_store_return_value)
(sh64_show_media_regs, sh64_show_compact_regs, sh64_register_type)
(sh64_do_fp_register, sh64_media_print_registers_info): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers)
(invalidate_cache): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_fpreg)
(mipsnbsd_fill_fpreg): Likewise.
* mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers)
(mipsnbsd_store_inferior_registers): Likewise.
* mips-linux-tdep.c (mips_supply_fpregset, mips_fill_fpregset)
(mips64_supply_fpregset, mips64_fill_fpregset): Likewise.
* mips-linux-nat.c (mips64_linux_register_addr): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_convert_register_p): Likewise.
* m68klinux-nat.c (getfpregs_supplies, supply_fpregset)
(fill_fpregset): Likewise.
* irix5-nat.c (supply_fpregset, fill_fpregset): Likewise.
* i386-tdep.h (struct_return): Likewise (comment).
* i386-nto-tdep.c (i386nto_register_area): Likewise.
* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
(go32_store_registers): Likewise.
* alpha-tdep.c (alpha_next_pc): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* alphabsd-nat.c (alphabsd_fetch_inferior_registers)
(alphabsd_store_inferior_registers): Likewise.
* core-regset.c (fetch_core_registers): Likewise.
* i386v4-nat.c (supply_fpregset, fill_fpregset): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
2007-06-18 19:45:26 +02:00
|
|
|
&saved_sp);
|
2007-05-13 14:27:30 +02:00
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
/* Go through the argument list twice.
|
2002-05-30 03:21:53 +02:00
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
Pass 1: Figure out how much new stack space is required for
|
|
|
|
arguments and pushed values. Unlike the PowerOpen ABI, the SysV
|
|
|
|
ABI doesn't reserve any extra space for parameters which are put
|
|
|
|
in registers, but does always push structures and then pass their
|
|
|
|
address.
|
2003-09-09 22:22:37 +02:00
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
Pass 2: Replay the same computation but this time also write the
|
|
|
|
values out to the target. */
|
2002-05-30 03:21:53 +02:00
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
for (write_pass = 0; write_pass < 2; write_pass++)
|
|
|
|
{
|
|
|
|
int argno;
|
|
|
|
/* Next available floating point register for float and double
|
|
|
|
arguments. */
|
|
|
|
int freg = 1;
|
|
|
|
/* Next available general register for non-float, non-vector
|
|
|
|
arguments. */
|
|
|
|
int greg = 3;
|
|
|
|
/* Next available vector register for vector arguments. */
|
|
|
|
int vreg = 2;
|
|
|
|
/* Arguments start above the "LR save word" and "Back chain". */
|
|
|
|
int argoffset = 2 * tdep->wordsize;
|
|
|
|
/* Structures start after the arguments. */
|
|
|
|
int structoffset = argoffset + argspace;
|
|
|
|
|
|
|
|
/* If the function is returning a `struct', then the first word
|
2003-10-07 00:23:47 +02:00
|
|
|
(which will be passed in r3) is used for struct return
|
|
|
|
address. In that case we should advance one word and start
|
|
|
|
from r4 register to copy parameters. */
|
2003-09-12 20:55:24 +02:00
|
|
|
if (struct_return)
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
if (write_pass)
|
|
|
|
regcache_cooked_write_signed (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg,
|
|
|
|
struct_addr);
|
|
|
|
greg++;
|
2002-05-30 03:21:53 +02:00
|
|
|
}
|
2003-09-12 20:55:24 +02:00
|
|
|
|
|
|
|
for (argno = 0; argno < nargs; argno++)
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
struct value *arg = args[argno];
|
2004-11-12 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_TYPE, VALUE_NEXT, VALUE_OFFSET, VALUE_BITSIZE)
(VALUE_BITPOS): Delete.
(value_type, value_offset, value_bitsize, value_bitpos): Declare.
* value.c (value_type, value_offset, value_bitpos)
(value_bitsize): New functions. Update references.
* arm-tdep.c, gnu-v3-abi.c, hpacc-abi.c, gnu-v2-abi.c: Update.
* f-valprint.c, cp-valprint.c, c-valprint.c: Update.
* ada-valprint.c, typeprint.c, scm-valprint.c, scm-exp.c: Update.
* p-valprint.c, jv-valprint.c, jv-lang.c, varobj.c: Update.
* objc-lang.c, ada-lang.c, std-regs.c, stack.c: Update.
* infcall.c, linespec.c, printcmd.c, valarith.c: Update.
* valops.c, eval.c, findvar.c, breakpoint.c: Update.
* tracepoint.c, ax-gdb.c, mi/mi-main.c, cli/cli-dump.c:
* rs6000-tdep.c, ppc-sysv-tdep.c: Update.
2004-11-12 22:45:08 +01:00
|
|
|
struct type *type = check_typedef (value_type (arg));
|
2003-09-12 20:55:24 +02:00
|
|
|
int len = TYPE_LENGTH (type);
|
2005-02-06 Andrew Cagney <cagney@gnu.org>
* value.c (value_contents, value_contents_writeable): New
functions.
* value.h (VALUE_CONTENTS): Delete macro.
(value_contents, value_contents_writeable): Declare.
* xstormy16-tdep.c, value.c, valops.c, valarith.c: Update.
* stack.c, sparc-tdep.c, sparc64-tdep.c, sh-tdep.c: Update.
* sh64-tdep.c, scm-valprint.c, scm-exp.c, s390-tdep.c: Update.
* rs6000-tdep.c, p-valprint.c, printcmd.c: Update.
* ppc-sysv-tdep.c, mips-tdep.c, mi/mi-main.c: Update.
* m88k-tdep.c, m68hc11-tdep.c, m32r-tdep.c: Update.
* jv-valprint.c, ia64-tdep.c, hppa-tdep.c: Update.
* hpacc-abi.c, f-valprint.c, frv-tdep.c, eval.c: Update.
* c-valprint.c, cris-tdep.c, cp-valprint.c: Update.
* cli/cli-dump.c, breakpoint.c, avr-tdep.c, arm-tdep.c: Update.
* arm-linux-tdep.c, amd64-tdep.c, alpha-tdep.c: Update.
* ada-valprint.c, ada-lang.c: Update.
2005-02-07 01:09:56 +01:00
|
|
|
const bfd_byte *val = value_contents (arg);
|
2003-09-12 20:55:24 +02:00
|
|
|
|
2007-10-30 20:35:35 +01:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8
|
|
|
|
&& !tdep->soft_float)
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
/* Floating point value converted to "double" then
|
2003-10-07 00:23:47 +02:00
|
|
|
passed in an FP register, when the registers run out,
|
|
|
|
8 byte aligned stack is used. */
|
2003-09-12 20:55:24 +02:00
|
|
|
if (freg <= 8)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
/* Always store the floating point value using
|
2003-10-07 00:23:47 +02:00
|
|
|
the register's floating-point format. */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
2003-09-12 20:55:24 +02:00
|
|
|
struct type *regtype
|
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its
derivatives.
* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
tdep->ppc_fp0_regnum.
(ppc_supply_fpregset, ppc_collect_fpregset)
(rs6000_push_dummy_call, rs6000_extract_return_value)
(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
FP0_REGNUM.
* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
Same.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
bdm_ppc_store_registers): Same.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_register)
(store_register, fill_fpregset): Same.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache)
(ppc_linux_supply_fpregset): Same.
* ppcnbsd-nat.c (getfpregs_supplies): Same.
* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
Same.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers, fetch_core_registers): Same.
2004-05-05 03:46:55 +02:00
|
|
|
= register_type (gdbarch, tdep->ppc_fp0_regnum + freg);
|
2003-09-12 20:55:24 +02:00
|
|
|
convert_typed_floating (val, type, regval, regtype);
|
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its
derivatives.
* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
tdep->ppc_fp0_regnum.
(ppc_supply_fpregset, ppc_collect_fpregset)
(rs6000_push_dummy_call, rs6000_extract_return_value)
(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
FP0_REGNUM.
* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
Same.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
bdm_ppc_store_registers): Same.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_register)
(store_register, fill_fpregset): Same.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache)
(ppc_linux_supply_fpregset): Same.
* ppcnbsd-nat.c (getfpregs_supplies): Same.
* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
Same.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers, fetch_core_registers): Same.
2004-05-05 03:46:55 +02:00
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg,
|
2003-09-12 20:55:24 +02:00
|
|
|
regval);
|
|
|
|
}
|
|
|
|
freg++;
|
|
|
|
}
|
2002-05-30 03:21:53 +02:00
|
|
|
else
|
|
|
|
{
|
2008-02-02 01:07:57 +01:00
|
|
|
/* The SysV ABI tells us to convert floats to
|
|
|
|
doubles before writing them to an 8 byte aligned
|
|
|
|
stack location. Unfortunately GCC does not do
|
|
|
|
that, and stores floats into 4 byte aligned
|
|
|
|
locations without converting them to doubles.
|
|
|
|
Since there is no know compiler that actually
|
|
|
|
follows the ABI here, we implement the GCC
|
|
|
|
convention. */
|
|
|
|
|
|
|
|
/* Align to 4 bytes or 8 bytes depending on the type of
|
|
|
|
the argument (float or double). */
|
|
|
|
argoffset = align_up (argoffset, len);
|
2003-09-12 20:55:24 +02:00
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, len);
|
2008-02-02 01:07:57 +01:00
|
|
|
argoffset += len;
|
2002-05-30 03:21:53 +02:00
|
|
|
}
|
|
|
|
}
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
&& len == 16
|
|
|
|
&& !tdep->soft_float
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
== floatformats_ibm_long_double))
|
|
|
|
{
|
|
|
|
/* IBM long double passed in two FP registers if
|
|
|
|
available, otherwise 8-byte aligned stack. */
|
|
|
|
if (freg <= 7)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg,
|
|
|
|
val);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg + 1,
|
|
|
|
val + 8);
|
|
|
|
}
|
|
|
|
freg += 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, len);
|
|
|
|
argoffset += 16;
|
|
|
|
}
|
|
|
|
}
|
2007-10-30 20:35:35 +01:00
|
|
|
else if (len == 8
|
|
|
|
&& (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
|
2008-06-26 17:38:39 +02:00
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_FLT /* double */
|
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_DECFLOAT
|
|
|
|
&& tdep->soft_float)))
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2008-06-26 17:38:39 +02:00
|
|
|
/* "long long" or soft-float "double" or "_Decimal64"
|
|
|
|
passed in an odd/even register pair with the low
|
|
|
|
addressed word in the odd register and the high
|
|
|
|
addressed word in the even register, or when the
|
|
|
|
registers run out an 8 byte aligned stack
|
|
|
|
location. */
|
2003-09-12 20:55:24 +02:00
|
|
|
if (greg > 9)
|
|
|
|
{
|
|
|
|
/* Just in case GREG was 10. */
|
|
|
|
greg = 11;
|
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, len);
|
|
|
|
argoffset += 8;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Must start on an odd register - r3/r4 etc. */
|
|
|
|
if ((greg & 1) == 0)
|
|
|
|
greg++;
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 0,
|
|
|
|
val + 0);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 1,
|
|
|
|
val + 4);
|
|
|
|
}
|
|
|
|
greg += 2;
|
|
|
|
}
|
2002-05-30 03:21:53 +02:00
|
|
|
}
|
2008-06-26 17:38:39 +02:00
|
|
|
else if (len == 16
|
|
|
|
&& ((TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
|
|
|
== floatformats_ibm_long_double))
|
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_DECFLOAT
|
|
|
|
&& tdep->soft_float)))
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
{
|
2008-06-26 17:38:39 +02:00
|
|
|
/* Soft-float IBM long double or _Decimal128 passed in
|
|
|
|
four consecutive registers, or on the stack. The
|
|
|
|
registers are not necessarily odd/even pairs. */
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
if (greg > 7)
|
|
|
|
{
|
|
|
|
greg = 11;
|
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, len);
|
|
|
|
argoffset += 16;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 0,
|
|
|
|
val + 0);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 1,
|
|
|
|
val + 4);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 2,
|
|
|
|
val + 8);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg + 3,
|
|
|
|
val + 12);
|
|
|
|
}
|
|
|
|
greg += 4;
|
|
|
|
}
|
|
|
|
}
|
2008-01-30 04:18:39 +01:00
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && len <= 8
|
|
|
|
&& !tdep->soft_float)
|
|
|
|
{
|
|
|
|
/* 32-bit and 64-bit decimal floats go in f1 .. f8. They can
|
|
|
|
end up in memory. */
|
|
|
|
|
|
|
|
if (freg <= 8)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
const gdb_byte *p;
|
|
|
|
|
|
|
|
/* 32-bit decimal floats are right aligned in the
|
|
|
|
doubleword. */
|
|
|
|
if (TYPE_LENGTH (type) == 4)
|
|
|
|
{
|
|
|
|
memcpy (regval + 4, val, 4);
|
|
|
|
p = regval;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
p = val;
|
|
|
|
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
freg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, len);
|
|
|
|
|
|
|
|
if (write_pass)
|
|
|
|
/* Write value in the stack's parameter save area. */
|
|
|
|
write_memory (sp + argoffset, val, len);
|
|
|
|
|
|
|
|
argoffset += len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && len == 16
|
|
|
|
&& !tdep->soft_float)
|
|
|
|
{
|
|
|
|
/* 128-bit decimal floats go in f2 .. f7, always in even/odd
|
|
|
|
pairs. They can end up in memory, using two doublewords. */
|
|
|
|
|
|
|
|
if (freg <= 6)
|
|
|
|
{
|
|
|
|
/* Make sure freg is even. */
|
|
|
|
freg += freg & 1;
|
|
|
|
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg, val);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_fp0_regnum + freg + 1, val + 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, 16);
|
|
|
|
|
|
|
|
argoffset += 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If a 128-bit decimal float goes to the stack because only f7
|
|
|
|
and f8 are free (thus there's no even/odd register pair
|
|
|
|
available), these registers should be marked as occupied.
|
|
|
|
Hence we increase freg even when writing to memory. */
|
|
|
|
freg += 2;
|
|
|
|
}
|
2011-02-08 14:30:10 +01:00
|
|
|
else if (len < 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& opencl_abi)
|
|
|
|
{
|
|
|
|
/* OpenCL vectors shorter than 16 bytes are passed as if
|
|
|
|
a series of independent scalars. */
|
|
|
|
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
|
|
|
|
int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype);
|
|
|
|
|
|
|
|
for (i = 0; i < nelt; i++)
|
|
|
|
{
|
|
|
|
const gdb_byte *elval = val + i * TYPE_LENGTH (eltype);
|
|
|
|
|
|
|
|
if (TYPE_CODE (eltype) == TYPE_CODE_FLT && !tdep->soft_float)
|
|
|
|
{
|
|
|
|
if (freg <= 8)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + freg;
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
struct type *regtype
|
|
|
|
= register_type (gdbarch, regnum);
|
|
|
|
convert_typed_floating (elval, eltype,
|
|
|
|
regval, regtype);
|
|
|
|
regcache_cooked_write (regcache, regnum, regval);
|
|
|
|
}
|
|
|
|
freg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, len);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, len);
|
|
|
|
argoffset += len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (TYPE_LENGTH (eltype) == 8)
|
|
|
|
{
|
|
|
|
if (greg > 9)
|
|
|
|
{
|
|
|
|
/* Just in case GREG was 10. */
|
|
|
|
greg = 11;
|
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, elval,
|
|
|
|
TYPE_LENGTH (eltype));
|
|
|
|
argoffset += 8;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Must start on an odd register - r3/r4 etc. */
|
|
|
|
if ((greg & 1) == 0)
|
|
|
|
greg++;
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_gp0_regnum + greg;
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
regnum + 0, elval + 0);
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
regnum + 1, elval + 4);
|
|
|
|
}
|
|
|
|
greg += 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdb_byte word[MAX_REGISTER_SIZE];
|
|
|
|
store_unsigned_integer (word, tdep->wordsize, byte_order,
|
|
|
|
unpack_long (eltype, elval));
|
|
|
|
|
|
|
|
if (greg <= 10)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + greg,
|
|
|
|
word);
|
|
|
|
greg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, tdep->wordsize);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, word, tdep->wordsize);
|
|
|
|
argoffset += tdep->wordsize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (len >= 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& opencl_abi)
|
|
|
|
{
|
|
|
|
/* OpenCL vectors 16 bytes or longer are passed as if
|
|
|
|
a series of AltiVec vectors. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < len / 16; i++)
|
|
|
|
{
|
|
|
|
const gdb_byte *elval = val + i * 16;
|
|
|
|
|
|
|
|
if (vreg <= 13)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
regcache_cooked_write (regcache,
|
|
|
|
tdep->ppc_vr0_regnum + vreg,
|
|
|
|
elval);
|
|
|
|
vreg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, 16);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, elval, 16);
|
|
|
|
argoffset += 16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-09-12 20:55:24 +02:00
|
|
|
else if (len == 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
2007-10-30 20:35:35 +01:00
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
|
2002-05-30 03:21:53 +02:00
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
/* Vector parameter passed in an Altivec register, or
|
2003-10-07 00:23:47 +02:00
|
|
|
when that runs out, 16 byte aligned stack location. */
|
2002-05-30 03:21:53 +02:00
|
|
|
if (vreg <= 13)
|
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
if (write_pass)
|
2007-06-16 00:34:13 +02:00
|
|
|
regcache_cooked_write (regcache,
|
2003-10-07 00:23:47 +02:00
|
|
|
tdep->ppc_vr0_regnum + vreg, val);
|
2002-05-30 03:21:53 +02:00
|
|
|
vreg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
argoffset = align_up (argoffset, 16);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, 16);
|
2002-05-30 03:21:53 +02:00
|
|
|
argoffset += 16;
|
|
|
|
}
|
|
|
|
}
|
2003-10-07 00:23:47 +02:00
|
|
|
else if (len == 8
|
2003-03-17 19:27:07 +01:00
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
2007-10-30 20:35:35 +01:00
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_SPE)
|
2003-10-07 00:23:47 +02:00
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
/* Vector parameter passed in an e500 register, or when
|
2003-10-07 00:23:47 +02:00
|
|
|
that runs out, 8 byte aligned stack location. Note
|
|
|
|
that since e500 vector and general purpose registers
|
|
|
|
both map onto the same underlying register set, a
|
|
|
|
"greg" and not a "vreg" is consumed here. A cooked
|
|
|
|
write stores the value in the correct locations
|
|
|
|
within the raw register cache. */
|
|
|
|
if (greg <= 10)
|
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
if (write_pass)
|
2007-06-16 00:34:13 +02:00
|
|
|
regcache_cooked_write (regcache,
|
2003-10-07 00:23:47 +02:00
|
|
|
tdep->ppc_ev0_regnum + greg, val);
|
|
|
|
greg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-09-12 20:55:24 +02:00
|
|
|
argoffset = align_up (argoffset, 8);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, val, 8);
|
2003-10-07 00:23:47 +02:00
|
|
|
argoffset += 8;
|
|
|
|
}
|
|
|
|
}
|
2003-09-12 20:55:24 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Reduce the parameter down to something that fits in a
|
2003-10-07 00:23:47 +02:00
|
|
|
"word". */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte word[MAX_REGISTER_SIZE];
|
2003-09-12 20:55:24 +02:00
|
|
|
memset (word, 0, MAX_REGISTER_SIZE);
|
|
|
|
if (len > tdep->wordsize
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_STRUCT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
|
|
|
{
|
2007-10-30 20:35:35 +01:00
|
|
|
/* Structs and large values are put in an
|
2011-01-10 21:38:51 +01:00
|
|
|
aligned stack slot ... */
|
2007-10-30 20:35:35 +01:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& len >= 16)
|
|
|
|
structoffset = align_up (structoffset, 16);
|
|
|
|
else
|
|
|
|
structoffset = align_up (structoffset, 8);
|
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + structoffset, val, len);
|
|
|
|
/* ... and then a "word" pointing to that address is
|
2003-10-07 00:23:47 +02:00
|
|
|
passed as the parameter. */
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
store_unsigned_integer (word, tdep->wordsize, byte_order,
|
2003-09-12 20:55:24 +02:00
|
|
|
sp + structoffset);
|
|
|
|
structoffset += len;
|
|
|
|
}
|
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_INT)
|
|
|
|
/* Sign or zero extend the "int" into a "word". */
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
store_unsigned_integer (word, tdep->wordsize, byte_order,
|
2003-09-12 20:55:24 +02:00
|
|
|
unpack_long (type, val));
|
|
|
|
else
|
|
|
|
/* Always goes in the low address. */
|
|
|
|
memcpy (word, val, len);
|
|
|
|
/* Store that "word" in a register, or on the stack.
|
2003-10-07 00:23:47 +02:00
|
|
|
The words have "4" byte alignment. */
|
2003-09-12 20:55:24 +02:00
|
|
|
if (greg <= 10)
|
|
|
|
{
|
|
|
|
if (write_pass)
|
|
|
|
regcache_cooked_write (regcache,
|
2003-10-07 00:23:47 +02:00
|
|
|
tdep->ppc_gp0_regnum + greg, word);
|
2003-09-12 20:55:24 +02:00
|
|
|
greg++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
argoffset = align_up (argoffset, tdep->wordsize);
|
|
|
|
if (write_pass)
|
|
|
|
write_memory (sp + argoffset, word, tdep->wordsize);
|
|
|
|
argoffset += tdep->wordsize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compute the actual stack space requirements. */
|
|
|
|
if (!write_pass)
|
|
|
|
{
|
|
|
|
/* Remember the amount of space needed by the arguments. */
|
|
|
|
argspace = argoffset;
|
|
|
|
/* Allocate space for both the arguments and the structures. */
|
|
|
|
sp -= (argoffset + structoffset);
|
|
|
|
/* Ensure that the stack is still 16 byte aligned. */
|
|
|
|
sp = align_down (sp, 16);
|
|
|
|
}
|
2005-08-16 19:12:35 +02:00
|
|
|
|
|
|
|
/* The psABI says that "A caller of a function that takes a
|
|
|
|
variable argument list shall set condition register bit 6 to
|
|
|
|
1 if it passes one or more arguments in the floating-point
|
2011-01-10 21:38:51 +01:00
|
|
|
registers. It is strongly recommended that the caller set the
|
2005-08-16 19:12:35 +02:00
|
|
|
bit to 0 otherwise..." Doing this for normal functions too
|
|
|
|
shouldn't hurt. */
|
|
|
|
if (write_pass)
|
|
|
|
{
|
|
|
|
ULONGEST cr;
|
|
|
|
|
|
|
|
regcache_cooked_read_unsigned (regcache, tdep->ppc_cr_regnum, &cr);
|
|
|
|
if (freg > 1)
|
|
|
|
cr |= 0x02000000;
|
|
|
|
else
|
|
|
|
cr &= ~0x02000000;
|
|
|
|
regcache_cooked_write_unsigned (regcache, tdep->ppc_cr_regnum, cr);
|
|
|
|
}
|
2002-05-30 03:21:53 +02:00
|
|
|
}
|
|
|
|
|
2003-09-12 20:55:24 +02:00
|
|
|
/* Update %sp. */
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
regcache_cooked_write_signed (regcache, gdbarch_sp_regnum (gdbarch), sp);
|
2003-09-12 20:55:24 +02:00
|
|
|
|
|
|
|
/* Write the backchain (it occupies WORDSIZED bytes). */
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
write_memory_signed_integer (sp, tdep->wordsize, byte_order, saved_sp);
|
2003-09-12 20:55:24 +02:00
|
|
|
|
2003-09-10 00:41:47 +02:00
|
|
|
/* Point the inferior function call's return address at the dummy's
|
|
|
|
breakpoint. */
|
2003-09-12 20:55:24 +02:00
|
|
|
regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
|
2003-09-10 00:41:47 +02:00
|
|
|
|
2002-05-30 03:21:53 +02:00
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Handle the return-value conventions for Decimal Floating Point values. */
|
2008-01-30 04:18:39 +01:00
|
|
|
static int
|
|
|
|
get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
|
|
|
|
struct regcache *regcache, gdb_byte *readbuf,
|
|
|
|
const gdb_byte *writebuf)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
|
|
|
|
gdb_assert (TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT);
|
|
|
|
|
|
|
|
/* 32-bit and 64-bit decimal floats in f1. */
|
|
|
|
if (TYPE_LENGTH (valtype) <= 8)
|
|
|
|
{
|
|
|
|
if (writebuf != NULL)
|
|
|
|
{
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
const gdb_byte *p;
|
|
|
|
|
|
|
|
/* 32-bit decimal float is right aligned in the doubleword. */
|
|
|
|
if (TYPE_LENGTH (valtype) == 4)
|
|
|
|
{
|
|
|
|
memcpy (regval + 4, writebuf, 4);
|
|
|
|
p = regval;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
p = writebuf;
|
|
|
|
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, p);
|
|
|
|
}
|
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, readbuf);
|
|
|
|
|
|
|
|
/* Left align 32-bit decimal float. */
|
|
|
|
if (TYPE_LENGTH (valtype) == 4)
|
|
|
|
memcpy (readbuf, readbuf + 4, 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* 128-bit decimal floats in f2,f3. */
|
|
|
|
else if (TYPE_LENGTH (valtype) == 16)
|
|
|
|
{
|
|
|
|
if (writebuf != NULL || readbuf != NULL)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++)
|
|
|
|
{
|
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2 + i,
|
|
|
|
writebuf + i * 8);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 2 + i,
|
|
|
|
readbuf + i * 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* Can't happen. */
|
2011-01-11 16:10:03 +01:00
|
|
|
internal_error (__FILE__, __LINE__, _("Unknown decimal float size."));
|
2008-01-30 04:18:39 +01:00
|
|
|
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
|
2003-10-10 23:32:47 +02:00
|
|
|
/* Handle the return-value conventions specified by the SysV 32-bit
|
|
|
|
PowerPC ABI (including all the supplements):
|
|
|
|
|
|
|
|
no floating-point: floating-point values returned using 32-bit
|
|
|
|
general-purpose registers.
|
|
|
|
|
|
|
|
Altivec: 128-bit vectors returned using vector registers.
|
|
|
|
|
|
|
|
e500: 64-bit vectors returned using the full full 64 bit EV
|
|
|
|
register, floating-point values returned using 32-bit
|
|
|
|
general-purpose registers.
|
|
|
|
|
|
|
|
GCC (broken): Small struct values right (instead of left) aligned
|
|
|
|
when returned in general-purpose registers. */
|
|
|
|
|
|
|
|
static enum return_value_convention
|
2011-02-08 14:30:10 +01:00
|
|
|
do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
|
|
|
struct type *type, struct regcache *regcache,
|
|
|
|
gdb_byte *readbuf, const gdb_byte *writebuf,
|
|
|
|
int broken_gcc)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2003-11-07 21:44:51 +01:00
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
2011-10-26 19:21:53 +02:00
|
|
|
int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0;
|
2011-02-08 14:30:10 +01:00
|
|
|
|
2003-10-10 23:32:47 +02:00
|
|
|
gdb_assert (tdep->wordsize == 4);
|
2011-02-08 14:30:10 +01:00
|
|
|
|
2003-10-10 23:32:47 +02:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
&& TYPE_LENGTH (type) <= 8
|
2007-10-30 20:35:35 +01:00
|
|
|
&& !tdep->soft_float)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Floats and doubles stored in "f1". Convert the value to
|
|
|
|
the required type. */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its
derivatives.
* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
tdep->ppc_fp0_regnum.
(ppc_supply_fpregset, ppc_collect_fpregset)
(rs6000_push_dummy_call, rs6000_extract_return_value)
(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
FP0_REGNUM.
* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
Same.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
bdm_ppc_store_registers): Same.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_register)
(store_register, fill_fpregset): Same.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache)
(ppc_linux_supply_fpregset): Same.
* ppcnbsd-nat.c (getfpregs_supplies): Same.
* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
Same.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers, fetch_core_registers): Same.
2004-05-05 03:46:55 +02:00
|
|
|
struct type *regtype = register_type (gdbarch,
|
|
|
|
tdep->ppc_fp0_regnum + 1);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
|
2003-11-10 23:47:31 +01:00
|
|
|
convert_typed_floating (regval, regtype, readbuf, type);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Floats and doubles stored in "f1". Convert the value to
|
|
|
|
the register's "double" type. */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its
derivatives.
* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
tdep->ppc_fp0_regnum.
(ppc_supply_fpregset, ppc_collect_fpregset)
(rs6000_push_dummy_call, rs6000_extract_return_value)
(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
FP0_REGNUM.
* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
Same.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
bdm_ppc_store_registers): Same.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_register)
(store_register, fill_fpregset): Same.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache)
(ppc_linux_supply_fpregset): Same.
* ppcnbsd-nat.c (getfpregs_supplies): Same.
* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
Same.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers, fetch_core_registers): Same.
2004-05-05 03:46:55 +02:00
|
|
|
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
|
2003-11-10 23:47:31 +01:00
|
|
|
convert_typed_floating (writebuf, type, regval, regtype);
|
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its
derivatives.
* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
tdep->ppc_fp0_regnum.
(ppc_supply_fpregset, ppc_collect_fpregset)
(rs6000_push_dummy_call, rs6000_extract_return_value)
(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
FP0_REGNUM.
* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
Same.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
bdm_ppc_store_registers): Same.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_register)
(store_register, fill_fpregset): Same.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache)
(ppc_linux_supply_fpregset): Same.
* ppcnbsd-nat.c (getfpregs_supplies): Same.
* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
Same.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers, fetch_core_registers): Same.
2004-05-05 03:46:55 +02:00
|
|
|
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
&& TYPE_LENGTH (type) == 16
|
|
|
|
&& !tdep->soft_float
|
2011-01-10 21:38:51 +01:00
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
|
|
|
== floatformats_ibm_long_double))
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
{
|
|
|
|
/* IBM long double stored in f1 and f2. */
|
|
|
|
if (readbuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, readbuf);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 2,
|
|
|
|
readbuf + 8);
|
|
|
|
}
|
|
|
|
if (writebuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, writebuf);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2,
|
|
|
|
writebuf + 8);
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2008-06-26 17:38:39 +02:00
|
|
|
if (TYPE_LENGTH (type) == 16
|
|
|
|
&& ((TYPE_CODE (type) == TYPE_CODE_FLT
|
2011-01-10 21:38:51 +01:00
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
|
|
|
== floatformats_ibm_long_double))
|
2008-06-26 17:38:39 +02:00
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && tdep->soft_float)))
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
{
|
2008-06-26 17:38:39 +02:00
|
|
|
/* Soft-float IBM long double or _Decimal128 stored in r3, r4,
|
|
|
|
r5, r6. */
|
include:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.h (struct floatformat): Add split_half field.
(floatformat_ibm_long_double): New.
libiberty:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* floatformat.c (mant_bits_set): New.
(floatformat_to_double): Use it. Note no special handling of
split formats.
(floatformat_from_double): Note no special handing of split
formats.
(floatformat_ibm_long_double_is_valid,
floatformat_ibm_long_double): New.
(floatformat_ieee_single_big, floatformat_ieee_single_little,
floatformat_ieee_double_big, floatformat_ieee_double_little,
floatformat_ieee_double_littlebyte_bigword, floatformat_vax_f,
floatformat_vax_d, floatformat_vax_g, floatformat_i387_ext,
floatformat_m68881_ext, floatformat_i960_ext,
floatformat_m88110_ext, floatformat_m88110_harris_ext,
floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword,
floatformat_ia64_spill_big, floatformat_ia64_spill_little,
floatformat_ia64_quad_big, floatformat_ia64_quad_little): Update
for addition of split_half field.
gdb:
2007-11-07 Joseph Myers <joseph@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdbtypes.c (floatformats_ibm_long_double): New.
* gdbtypes.h (floatformats_ibm_long_double): Declare.
* ia64-tdep.c (floatformat_ia64_ext): Update for addition of
split_half field.
* mips-tdep.c (n32n64_floatformat_always_valid,
floatformat_n32n64_long_double_big, floatformats_n32n64_long):
Remove.
(mips_gdbarch_init): Use floatformats_ibm_long_double instead of
floatformats_n32n64_long.
* ppc-linux-tdep.c (ppc_linux_init_abi): Use 128-bit IBM long
double.
* doublest.c (convert_floatformat_to_doublest,
convert_doublest_to_floatformat): Handle split floating-point
formats.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Handle IBM long
double arguments.
(ppc64_sysv_abi_push_dummy_call): Likewise.
(do_ppc_sysv_return_value): Handle IBM long double return.
2007-11-08 01:08:48 +01:00
|
|
|
if (readbuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
readbuf + 4);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 5,
|
|
|
|
readbuf + 8);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 6,
|
|
|
|
readbuf + 12);
|
|
|
|
}
|
|
|
|
if (writebuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
writebuf + 4);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5,
|
|
|
|
writebuf + 8);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6,
|
|
|
|
writebuf + 12);
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2003-10-10 23:32:47 +02:00
|
|
|
if ((TYPE_CODE (type) == TYPE_CODE_INT && TYPE_LENGTH (type) == 8)
|
2008-06-26 17:38:39 +02:00
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8)
|
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && TYPE_LENGTH (type) == 8
|
|
|
|
&& tdep->soft_float))
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2008-06-26 17:38:39 +02:00
|
|
|
/* A long long, double or _Decimal64 stored in the 32 bit
|
|
|
|
r3/r4. */
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
|
2007-10-30 20:35:35 +01:00
|
|
|
readbuf + 0);
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
2007-10-30 20:35:35 +01:00
|
|
|
readbuf + 4);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2008-06-26 17:38:39 +02:00
|
|
|
/* A long long, double or _Decimal64 stored in the 32 bit
|
|
|
|
r3/r4. */
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
|
2007-10-30 20:35:35 +01:00
|
|
|
writebuf + 0);
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
2007-10-30 20:35:35 +01:00
|
|
|
writebuf + 4);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2008-01-30 04:18:39 +01:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && !tdep->soft_float)
|
|
|
|
return get_decimal_float_return_value (gdbarch, type, regcache, readbuf,
|
|
|
|
writebuf);
|
2007-09-06 22:21:16 +02:00
|
|
|
else if ((TYPE_CODE (type) == TYPE_CODE_INT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_REF
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
|
|
|
&& TYPE_LENGTH (type) <= tdep->wordsize)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Some sort of integer stored in r3. Since TYPE isn't
|
|
|
|
bigger than the register, sign extension isn't a problem
|
|
|
|
- just do everything unsigned. */
|
|
|
|
ULONGEST regval;
|
|
|
|
regcache_cooked_read_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
®val);
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
store_unsigned_integer (readbuf, TYPE_LENGTH (type), byte_order,
|
|
|
|
regval);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Some sort of integer stored in r3. Use unpack_long since
|
|
|
|
that should handle any required sign extension. */
|
|
|
|
regcache_cooked_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
|
2003-11-10 23:47:31 +01:00
|
|
|
unpack_long (type, writebuf));
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2011-02-08 14:30:10 +01:00
|
|
|
/* OpenCL vectors < 16 bytes are returned as distinct
|
|
|
|
scalars in f1..f2 or r3..r10. */
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& TYPE_LENGTH (type) < 16
|
|
|
|
&& opencl_abi)
|
|
|
|
{
|
|
|
|
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
|
|
|
|
int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype);
|
|
|
|
|
|
|
|
for (i = 0; i < nelt; i++)
|
|
|
|
{
|
|
|
|
int offset = i * TYPE_LENGTH (eltype);
|
|
|
|
|
|
|
|
if (TYPE_CODE (eltype) == TYPE_CODE_FLT)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + 1 + i;
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
struct type *regtype = register_type (gdbarch, regnum);
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
{
|
|
|
|
convert_typed_floating (writebuf + offset, eltype,
|
|
|
|
regval, regtype);
|
|
|
|
regcache_cooked_write (regcache, regnum, regval);
|
|
|
|
}
|
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, regnum, regval);
|
|
|
|
convert_typed_floating (regval, regtype,
|
|
|
|
readbuf + offset, eltype);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_gp0_regnum + 3 + i;
|
|
|
|
ULONGEST regval;
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
{
|
|
|
|
regval = unpack_long (eltype, writebuf + offset);
|
|
|
|
regcache_cooked_write_unsigned (regcache, regnum, regval);
|
|
|
|
}
|
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_read_unsigned (regcache, regnum, ®val);
|
|
|
|
store_unsigned_integer (readbuf + offset,
|
|
|
|
TYPE_LENGTH (eltype), byte_order,
|
|
|
|
regval);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
/* OpenCL vectors >= 16 bytes are returned in v2..v9. */
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& TYPE_LENGTH (type) >= 16
|
|
|
|
&& opencl_abi)
|
|
|
|
{
|
|
|
|
int n_regs = TYPE_LENGTH (type) / 16;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_regs; i++)
|
|
|
|
{
|
|
|
|
int offset = i * 16;
|
|
|
|
int regnum = tdep->ppc_vr0_regnum + 2 + i;
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write (regcache, regnum, writebuf + offset);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read (regcache, regnum, readbuf + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2003-10-10 23:32:47 +02:00
|
|
|
if (TYPE_LENGTH (type) == 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
2007-10-30 20:35:35 +01:00
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Altivec places the return value in "v2". */
|
2003-11-10 23:47:31 +01:00
|
|
|
regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* Altivec places the return value in "v2". */
|
2003-11-10 23:47:31 +01:00
|
|
|
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2007-10-30 20:35:35 +01:00
|
|
|
if (TYPE_LENGTH (type) == 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_GENERIC)
|
|
|
|
{
|
|
|
|
/* GCC -maltivec -mabi=no-altivec returns vectors in r3/r4/r5/r6.
|
|
|
|
GCC without AltiVec returns them in memory, but it warns about
|
|
|
|
ABI risks in that case; we don't try to support it. */
|
|
|
|
if (readbuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
readbuf + 0);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
readbuf + 4);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 5,
|
|
|
|
readbuf + 8);
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 6,
|
|
|
|
readbuf + 12);
|
|
|
|
}
|
|
|
|
if (writebuf)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
writebuf + 0);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
writebuf + 4);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5,
|
|
|
|
writebuf + 8);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6,
|
|
|
|
writebuf + 12);
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
2003-10-10 23:32:47 +02:00
|
|
|
if (TYPE_LENGTH (type) == 8
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
2007-10-30 20:35:35 +01:00
|
|
|
&& TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_SPE)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* The e500 ABI places return values for the 64-bit DSP types
|
|
|
|
(__ev64_opaque__) in r3. However, in GDB-speak, ev3
|
|
|
|
corresponds to the entire r3 value for e500, whereas GDB's r3
|
|
|
|
only corresponds to the least significant 32-bits. So place
|
|
|
|
the 64-bit DSP type's value in ev3. */
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_ev0_regnum + 3, readbuf);
|
|
|
|
if (writebuf)
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_ev0_regnum + 3, writebuf);
|
2003-10-10 23:32:47 +02:00
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
if (broken_gcc && TYPE_LENGTH (type) <= 8)
|
|
|
|
{
|
2005-08-17 09:44:13 +02:00
|
|
|
/* GCC screwed up for structures or unions whose size is less
|
|
|
|
than or equal to 8 bytes.. Instead of left-aligning, it
|
|
|
|
right-aligns the data into the buffer formed by r3, r4. */
|
|
|
|
gdb_byte regvals[MAX_REGISTER_SIZE * 2];
|
|
|
|
int len = TYPE_LENGTH (type);
|
|
|
|
int offset = (2 * tdep->wordsize - len) % tdep->wordsize;
|
|
|
|
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2005-08-17 09:44:13 +02:00
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
regvals + 0 * tdep->wordsize);
|
|
|
|
if (len > tdep->wordsize)
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
regvals + 1 * tdep->wordsize);
|
|
|
|
memcpy (readbuf, regvals + offset, len);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2005-08-17 09:44:13 +02:00
|
|
|
memset (regvals, 0, sizeof regvals);
|
|
|
|
memcpy (regvals + offset, writebuf, len);
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
regvals + 0 * tdep->wordsize);
|
|
|
|
if (len > tdep->wordsize)
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
regvals + 1 * tdep->wordsize);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2005-08-17 09:44:13 +02:00
|
|
|
|
2003-10-10 23:32:47 +02:00
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
if (TYPE_LENGTH (type) <= 8)
|
|
|
|
{
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* This matches SVr4 PPC, it does not match GCC. */
|
|
|
|
/* The value is right-padded to 8 bytes and then loaded, as
|
|
|
|
two "words", into r3/r4. */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte regvals[MAX_REGISTER_SIZE * 2];
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
regvals + 0 * tdep->wordsize);
|
|
|
|
if (TYPE_LENGTH (type) > tdep->wordsize)
|
|
|
|
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
regvals + 1 * tdep->wordsize);
|
2003-11-10 23:47:31 +01:00
|
|
|
memcpy (readbuf, regvals, TYPE_LENGTH (type));
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
|
|
|
/* This matches SVr4 PPC, it does not match GCC. */
|
|
|
|
/* The value is padded out to 8 bytes and then loaded, as
|
|
|
|
two "words" into r3/r4. */
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte regvals[MAX_REGISTER_SIZE * 2];
|
2003-10-10 23:32:47 +02:00
|
|
|
memset (regvals, 0, sizeof regvals);
|
2003-11-10 23:47:31 +01:00
|
|
|
memcpy (regvals, writebuf, TYPE_LENGTH (type));
|
2003-10-10 23:32:47 +02:00
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
|
|
|
|
regvals + 0 * tdep->wordsize);
|
|
|
|
if (TYPE_LENGTH (type) > tdep->wordsize)
|
|
|
|
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
|
|
|
regvals + 1 * tdep->wordsize);
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_STRUCT_CONVENTION;
|
|
|
|
}
|
|
|
|
|
2003-11-07 21:44:51 +01:00
|
|
|
enum return_value_convention
|
2012-05-16 16:35:09 +02:00
|
|
|
ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
2008-04-22 13:03:42 +02:00
|
|
|
struct type *valtype, struct regcache *regcache,
|
|
|
|
gdb_byte *readbuf, const gdb_byte *writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2012-05-16 16:35:09 +02:00
|
|
|
return do_ppc_sysv_return_value (gdbarch,
|
|
|
|
function ? value_type (function) : NULL,
|
|
|
|
valtype, regcache, readbuf, writebuf, 0);
|
2003-10-10 23:32:47 +02:00
|
|
|
}
|
|
|
|
|
2003-11-07 21:44:51 +01:00
|
|
|
enum return_value_convention
|
2003-11-10 23:47:31 +01:00
|
|
|
ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
|
2012-05-16 16:35:09 +02:00
|
|
|
struct value *function,
|
2003-11-10 23:47:31 +01:00
|
|
|
struct type *valtype,
|
|
|
|
struct regcache *regcache,
|
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
for byte buffers.
(rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
(rs6000_software_single_step, sstep_breaks, skip_prologue)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_push_dummy_call, rs6000_push_dummy_call)
(rs6000_register_to_value, e500_pseudo_register_read)
(rs6000_store_return_value, e500_pseudo_register_write)
(rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
(do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
(ppc_sysv_abi_broken_return_value)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
* ppc-linux-tdep.c (ppc_linux_in_sigtramp)
(ppc_linux_at_sigtramp_return_path)
(ppc_linux_skip_trampoline_code)
(ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
* rs6000-tdep.c (rs6000_value_to_register)
(rs6000_register_to_value): Ditto.
* ppc-tdep.h (ppc_sysv_abi_return_value)
(ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
(ppc_linux_memory_remove_breakpoint): Ditto.
2005-05-25 05:12:13 +02:00
|
|
|
gdb_byte *readbuf, const gdb_byte *writebuf)
|
2003-10-10 23:32:47 +02:00
|
|
|
{
|
2012-05-16 16:35:09 +02:00
|
|
|
return do_ppc_sysv_return_value (gdbarch,
|
|
|
|
function ? value_type (function) : NULL,
|
|
|
|
valtype, regcache, readbuf, writebuf, 1);
|
2003-10-07 00:23:47 +02:00
|
|
|
}
|
2003-10-03 23:11:39 +02:00
|
|
|
|
2005-02-09 17:51:43 +01:00
|
|
|
/* The helper function for 64-bit SYSV push_dummy_call. Converts the
|
|
|
|
function's code address back into the function's descriptor
|
|
|
|
address.
|
|
|
|
|
|
|
|
Find a value for the TOC register. Every symbol should have both
|
|
|
|
".FN" and "FN" in the minimal symbol table. "FN" points at the
|
|
|
|
FN's descriptor, while ".FN" points at the entry point (which
|
|
|
|
matches FUNC_ADDR). Need to reverse from FUNC_ADDR back to the
|
|
|
|
FN's descriptor address (while at the same time being careful to
|
|
|
|
find "FN" in the same object file as ".FN"). */
|
|
|
|
|
|
|
|
static int
|
|
|
|
convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
|
|
|
|
{
|
|
|
|
struct obj_section *dot_fn_section;
|
* minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove objfile argument.
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
* minsyms.c (lookup_minimal_symbol_by_pc_1)
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
(in_gnu_ifunc_stub): Update.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove 'objfile_p' argument.
(lookup_solib_trampoline_symbol_by_pc): Update.
* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 21:59:09 +02:00
|
|
|
struct bound_minimal_symbol dot_fn;
|
2005-02-09 17:51:43 +01:00
|
|
|
struct minimal_symbol *fn;
|
* minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove objfile argument.
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
* minsyms.c (lookup_minimal_symbol_by_pc_1)
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
(in_gnu_ifunc_stub): Update.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove 'objfile_p' argument.
(lookup_solib_trampoline_symbol_by_pc): Update.
* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 21:59:09 +02:00
|
|
|
|
2005-02-09 17:51:43 +01:00
|
|
|
/* Find the minimal symbol that corresponds to CODE_ADDR (should
|
|
|
|
have a name of the form ".FN"). */
|
|
|
|
dot_fn = lookup_minimal_symbol_by_pc (code_addr);
|
* minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove objfile argument.
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
* minsyms.c (lookup_minimal_symbol_by_pc_1)
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
(in_gnu_ifunc_stub): Update.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove 'objfile_p' argument.
(lookup_solib_trampoline_symbol_by_pc): Update.
* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 21:59:09 +02:00
|
|
|
if (dot_fn.minsym == NULL || SYMBOL_LINKAGE_NAME (dot_fn.minsym)[0] != '.')
|
2005-02-09 17:51:43 +01:00
|
|
|
return 0;
|
|
|
|
/* Get the section that contains CODE_ADDR. Need this for the
|
|
|
|
"objfile" that it contains. */
|
|
|
|
dot_fn_section = find_pc_section (code_addr);
|
|
|
|
if (dot_fn_section == NULL || dot_fn_section->objfile == NULL)
|
|
|
|
return 0;
|
|
|
|
/* Now find the corresponding "FN" (dropping ".") minimal symbol's
|
|
|
|
address. Only look for the minimal symbol in ".FN"'s object file
|
|
|
|
- avoids problems when two object files (i.e., shared libraries)
|
|
|
|
contain a minimal symbol with the same name. */
|
* minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove objfile argument.
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
* minsyms.c (lookup_minimal_symbol_by_pc_1)
(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
Return bound_minimal_symbol.
(in_gnu_ifunc_stub): Update.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
Remove 'objfile_p' argument.
(lookup_solib_trampoline_symbol_by_pc): Update.
* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 21:59:09 +02:00
|
|
|
fn = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (dot_fn.minsym) + 1, NULL,
|
2005-02-09 17:51:43 +01:00
|
|
|
dot_fn_section->objfile);
|
|
|
|
if (fn == NULL)
|
|
|
|
return 0;
|
|
|
|
/* Found a descriptor. */
|
|
|
|
(*desc_addr) = SYMBOL_VALUE_ADDRESS (fn);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-02-04 18:42:35 +01:00
|
|
|
/* Walk down the type tree of TYPE counting consecutive base elements.
|
|
|
|
If *FIELD_TYPE is NULL, then set it to the first valid floating point
|
|
|
|
or vector type. If a non-floating point or vector type is found, or
|
|
|
|
if a floating point or vector type that doesn't match a non-NULL
|
|
|
|
*FIELD_TYPE is found, then return -1, otherwise return the count in the
|
|
|
|
sub-tree. */
|
|
|
|
|
|
|
|
static LONGEST
|
|
|
|
ppc64_aggregate_candidate (struct type *type,
|
|
|
|
struct type **field_type)
|
|
|
|
{
|
|
|
|
type = check_typedef (type);
|
|
|
|
|
|
|
|
switch (TYPE_CODE (type))
|
|
|
|
{
|
|
|
|
case TYPE_CODE_FLT:
|
|
|
|
case TYPE_CODE_DECFLOAT:
|
|
|
|
if (!*field_type)
|
|
|
|
*field_type = type;
|
|
|
|
if (TYPE_CODE (*field_type) == TYPE_CODE (type)
|
|
|
|
&& TYPE_LENGTH (*field_type) == TYPE_LENGTH (type))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPE_CODE_COMPLEX:
|
|
|
|
type = TYPE_TARGET_TYPE (type);
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
|
|
|
|
{
|
|
|
|
if (!*field_type)
|
|
|
|
*field_type = type;
|
|
|
|
if (TYPE_CODE (*field_type) == TYPE_CODE (type)
|
|
|
|
&& TYPE_LENGTH (*field_type) == TYPE_LENGTH (type))
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPE_CODE_ARRAY:
|
|
|
|
if (TYPE_VECTOR (type))
|
|
|
|
{
|
|
|
|
if (!*field_type)
|
|
|
|
*field_type = type;
|
|
|
|
if (TYPE_CODE (*field_type) == TYPE_CODE (type)
|
|
|
|
&& TYPE_LENGTH (*field_type) == TYPE_LENGTH (type))
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LONGEST count, low_bound, high_bound;
|
|
|
|
|
|
|
|
count = ppc64_aggregate_candidate
|
|
|
|
(TYPE_TARGET_TYPE (type), field_type);
|
|
|
|
if (count == -1)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (!get_array_bounds (type, &low_bound, &high_bound))
|
|
|
|
return -1;
|
|
|
|
count *= high_bound - low_bound;
|
|
|
|
|
|
|
|
/* There must be no padding. */
|
|
|
|
if (count == 0)
|
|
|
|
return TYPE_LENGTH (type) == 0 ? 0 : -1;
|
|
|
|
else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPE_CODE_STRUCT:
|
|
|
|
case TYPE_CODE_UNION:
|
|
|
|
{
|
|
|
|
LONGEST count = 0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < TYPE_NFIELDS (type); i++)
|
|
|
|
{
|
|
|
|
LONGEST sub_count;
|
|
|
|
|
|
|
|
if (field_is_static (&TYPE_FIELD (type, i)))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
sub_count = ppc64_aggregate_candidate
|
|
|
|
(TYPE_FIELD_TYPE (type, i), field_type);
|
|
|
|
if (sub_count == -1)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
|
|
|
count += sub_count;
|
|
|
|
else
|
|
|
|
count = max (count, sub_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* There must be no padding. */
|
|
|
|
if (count == 0)
|
|
|
|
return TYPE_LENGTH (type) == 0 ? 0 : -1;
|
|
|
|
else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If an argument of type TYPE is a homogeneous float or vector aggregate
|
|
|
|
that shall be passed in FP/vector registers according to the ELFv2 ABI,
|
|
|
|
return the homogeneous element type in *ELT_TYPE and the number of
|
|
|
|
elements in *N_ELTS, and return non-zero. Otherwise, return zero. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
ppc64_elfv2_abi_homogeneous_aggregate (struct type *type,
|
|
|
|
struct type **elt_type, int *n_elts)
|
|
|
|
{
|
|
|
|
/* Complex types at the top level are treated separately. However,
|
|
|
|
complex types can be elements of homogeneous aggregates. */
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
|
|
|
|| (TYPE_CODE (type) == TYPE_CODE_ARRAY && !TYPE_VECTOR (type)))
|
|
|
|
{
|
|
|
|
struct type *field_type = NULL;
|
|
|
|
LONGEST field_count = ppc64_aggregate_candidate (type, &field_type);
|
|
|
|
|
|
|
|
if (field_count > 0)
|
|
|
|
{
|
|
|
|
int n_regs = ((TYPE_CODE (field_type) == TYPE_CODE_FLT
|
|
|
|
|| TYPE_CODE (field_type) == TYPE_CODE_DECFLOAT)?
|
|
|
|
(TYPE_LENGTH (field_type) + 7) >> 3 : 1);
|
|
|
|
|
|
|
|
/* The ELFv2 ABI allows homogeneous aggregates to occupy
|
|
|
|
up to 8 registers. */
|
|
|
|
if (field_count * n_regs <= 8)
|
|
|
|
{
|
|
|
|
if (elt_type)
|
|
|
|
*elt_type = field_type;
|
|
|
|
if (n_elts)
|
|
|
|
*n_elts = (int) field_count;
|
|
|
|
/* Note that field_count is LONGEST since it may hold the size
|
|
|
|
of an array, while *n_elts is int since its value is bounded
|
|
|
|
by the number of registers used for argument passing. The
|
|
|
|
cast cannot overflow due to the bounds checking above. */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Structure holding the next argument position. */
|
|
|
|
struct ppc64_sysv_argpos
|
|
|
|
{
|
|
|
|
/* Register cache holding argument registers. If this is NULL,
|
|
|
|
we only simulate argument processing without actually updating
|
|
|
|
any registers or memory. */
|
|
|
|
struct regcache *regcache;
|
|
|
|
/* Next available general-purpose argument register. */
|
|
|
|
int greg;
|
|
|
|
/* Next available floating-point argument register. */
|
|
|
|
int freg;
|
|
|
|
/* Next available vector argument register. */
|
|
|
|
int vreg;
|
|
|
|
/* The address, at which the next general purpose parameter
|
|
|
|
(integer, struct, float, vector, ...) should be saved. */
|
|
|
|
CORE_ADDR gparam;
|
|
|
|
/* The address, at which the next by-reference parameter
|
|
|
|
(non-Altivec vector, variably-sized type) should be saved. */
|
|
|
|
CORE_ADDR refparam;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* VAL is a value of length LEN. Store it into the argument area on the
|
|
|
|
stack and load it into the corresponding general-purpose registers
|
|
|
|
required by the ABI, and update ARGPOS.
|
|
|
|
|
|
|
|
If ALIGN is nonzero, it specifies the minimum alignment required
|
|
|
|
for the on-stack copy of the argument. */
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
static void
|
|
|
|
ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
|
|
|
|
const bfd_byte *val, int len, int align,
|
|
|
|
struct ppc64_sysv_argpos *argpos)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
/* Enforce alignment of stack location, if requested. */
|
|
|
|
if (align > tdep->wordsize)
|
|
|
|
{
|
|
|
|
CORE_ADDR aligned_gparam = align_up (argpos->gparam, align);
|
|
|
|
|
|
|
|
argpos->greg += (aligned_gparam - argpos->gparam) / tdep->wordsize;
|
|
|
|
argpos->gparam = aligned_gparam;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The ABI (version 1.9) specifies that values smaller than one
|
|
|
|
doubleword are right-aligned and those larger are left-aligned.
|
|
|
|
GCC versions before 3.4 implemented this incorrectly; see
|
|
|
|
<http://gcc.gnu.org/gcc-3.4/powerpc-abi.html>. */
|
2014-02-04 18:26:26 +01:00
|
|
|
if (len < tdep->wordsize
|
|
|
|
&& gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
offset = tdep->wordsize - len;
|
|
|
|
|
|
|
|
if (argpos->regcache)
|
|
|
|
write_memory (argpos->gparam + offset, val, len);
|
|
|
|
argpos->gparam = align_up (argpos->gparam + len, tdep->wordsize);
|
|
|
|
|
|
|
|
while (len >= tdep->wordsize)
|
|
|
|
{
|
|
|
|
if (argpos->regcache && argpos->greg <= 10)
|
|
|
|
regcache_cooked_write (argpos->regcache,
|
|
|
|
tdep->ppc_gp0_regnum + argpos->greg, val);
|
|
|
|
argpos->greg++;
|
|
|
|
len -= tdep->wordsize;
|
|
|
|
val += tdep->wordsize;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (len > 0)
|
|
|
|
{
|
|
|
|
if (argpos->regcache && argpos->greg <= 10)
|
|
|
|
regcache_cooked_write_part (argpos->regcache,
|
|
|
|
tdep->ppc_gp0_regnum + argpos->greg,
|
|
|
|
offset, len, val);
|
|
|
|
argpos->greg++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The same as ppc64_sysv_abi_push_val, but using a single-word integer
|
|
|
|
value VAL as argument. */
|
2013-04-01 06:05:35 +02:00
|
|
|
|
|
|
|
static void
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ppc64_sysv_abi_push_integer (struct gdbarch *gdbarch, ULONGEST val,
|
|
|
|
struct ppc64_sysv_argpos *argpos)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
|
|
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (argpos->regcache)
|
|
|
|
store_unsigned_integer (buf, tdep->wordsize, byte_order, val);
|
|
|
|
ppc64_sysv_abi_push_val (gdbarch, buf, tdep->wordsize, 0, argpos);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* VAL is a value of TYPE, a (binary or decimal) floating-point type.
|
|
|
|
Load it into a floating-point register if required by the ABI,
|
|
|
|
and update ARGPOS. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
|
|
|
|
struct type *type, const bfd_byte *val,
|
|
|
|
struct ppc64_sysv_argpos *argpos)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
if (tdep->soft_float)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (TYPE_LENGTH (type) <= 8
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_FLT)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Floats and doubles go in f1 .. f13. 32-bit floats are converted
|
|
|
|
to double first. */
|
|
|
|
if (argpos->regcache && argpos->freg <= 13)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
|
|
|
|
struct type *regtype = register_type (gdbarch, regnum);
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
convert_typed_floating (val, type, regval, regtype);
|
|
|
|
regcache_cooked_write (argpos->regcache, regnum, regval);
|
|
|
|
}
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
argpos->freg++;
|
|
|
|
}
|
|
|
|
else if (TYPE_LENGTH (type) <= 8
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
|
|
|
|
{
|
|
|
|
/* Floats and doubles go in f1 .. f13. 32-bit decimal floats are
|
|
|
|
placed in the least significant word. */
|
|
|
|
if (argpos->regcache && argpos->freg <= 13)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
|
2014-02-04 18:33:04 +01:00
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
|
|
|
offset = 8 - TYPE_LENGTH (type);
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
regcache_cooked_write_part (argpos->regcache, regnum,
|
|
|
|
offset, TYPE_LENGTH (type), val);
|
|
|
|
}
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
argpos->freg++;
|
|
|
|
}
|
|
|
|
else if (TYPE_LENGTH (type) == 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
|
|
|
== floatformats_ibm_long_double))
|
|
|
|
{
|
|
|
|
/* IBM long double stored in two consecutive FPRs. */
|
|
|
|
if (argpos->regcache && argpos->freg <= 13)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
|
|
|
|
|
|
|
|
regcache_cooked_write (argpos->regcache, regnum, val);
|
|
|
|
if (argpos->freg <= 12)
|
|
|
|
regcache_cooked_write (argpos->regcache, regnum + 1, val + 8);
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
argpos->freg += 2;
|
|
|
|
}
|
|
|
|
else if (TYPE_LENGTH (type) == 16
|
|
|
|
&& TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
|
|
|
|
{
|
|
|
|
/* 128-bit decimal floating-point values are stored in and even/odd
|
|
|
|
pair of FPRs, with the even FPR holding the most significant half. */
|
|
|
|
argpos->freg += argpos->freg & 1;
|
2013-04-01 06:05:35 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (argpos->regcache && argpos->freg <= 12)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
|
2014-02-04 18:34:19 +01:00
|
|
|
int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0;
|
|
|
|
int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
|
2013-04-01 06:05:35 +02:00
|
|
|
|
2014-02-04 18:34:19 +01:00
|
|
|
regcache_cooked_write (argpos->regcache, regnum, val + hipart);
|
|
|
|
regcache_cooked_write (argpos->regcache, regnum + 1, val + lopart);
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
argpos->freg += 2;
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* VAL is a value of AltiVec vector type. Load it into a vector register
|
|
|
|
if required by the ABI, and update ARGPOS. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
ppc64_sysv_abi_push_vreg (struct gdbarch *gdbarch, const bfd_byte *val,
|
|
|
|
struct ppc64_sysv_argpos *argpos)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
|
|
|
|
if (argpos->regcache && argpos->vreg <= 13)
|
|
|
|
regcache_cooked_write (argpos->regcache,
|
|
|
|
tdep->ppc_vr0_regnum + argpos->vreg, val);
|
|
|
|
|
|
|
|
argpos->vreg++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* VAL is a value of TYPE. Load it into memory and/or registers
|
|
|
|
as required by the ABI, and update ARGPOS. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
|
|
|
|
struct type *type, const bfd_byte *val,
|
|
|
|
struct ppc64_sysv_argpos *argpos)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
|
|
|
|
{
|
|
|
|
/* Floating-point scalars are passed in floating-point registers. */
|
|
|
|
ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos);
|
|
|
|
ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos);
|
|
|
|
}
|
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
|
|
|
|
&& TYPE_LENGTH (type) == 16)
|
|
|
|
{
|
|
|
|
/* AltiVec vectors are passed aligned, and in vector registers. */
|
|
|
|
ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 16, argpos);
|
|
|
|
ppc64_sysv_abi_push_vreg (gdbarch, val, argpos);
|
|
|
|
}
|
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
|
|
|
&& TYPE_LENGTH (type) >= 16)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Non-Altivec vectors are passed by reference. */
|
|
|
|
|
|
|
|
/* Copy value onto the stack ... */
|
|
|
|
CORE_ADDR addr = align_up (argpos->refparam, 16);
|
|
|
|
if (argpos->regcache)
|
|
|
|
write_memory (addr, val, TYPE_LENGTH (type));
|
|
|
|
argpos->refparam = align_up (addr + TYPE_LENGTH (type), tdep->wordsize);
|
|
|
|
|
|
|
|
/* ... and pass a pointer to the copy as parameter. */
|
|
|
|
ppc64_sysv_abi_push_integer (gdbarch, addr, argpos);
|
|
|
|
}
|
|
|
|
else if ((TYPE_CODE (type) == TYPE_CODE_INT
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_ENUM
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_REF)
|
|
|
|
&& TYPE_LENGTH (type) <= tdep->wordsize)
|
|
|
|
{
|
|
|
|
ULONGEST word = 0;
|
|
|
|
|
|
|
|
if (argpos->regcache)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Sign extend the value, then store it unsigned. */
|
|
|
|
word = unpack_long (type, val);
|
|
|
|
|
|
|
|
/* Convert any function code addresses into descriptors. */
|
2014-02-04 18:40:16 +01:00
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V1
|
|
|
|
&& (TYPE_CODE (type) == TYPE_CODE_PTR
|
|
|
|
|| TYPE_CODE (type) == TYPE_CODE_REF))
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
{
|
|
|
|
struct type *target_type
|
|
|
|
= check_typedef (TYPE_TARGET_TYPE (type));
|
|
|
|
|
|
|
|
if (TYPE_CODE (target_type) == TYPE_CODE_FUNC
|
|
|
|
|| TYPE_CODE (target_type) == TYPE_CODE_METHOD)
|
|
|
|
{
|
|
|
|
CORE_ADDR desc = word;
|
|
|
|
|
|
|
|
convert_code_addr_to_desc_addr (word, &desc);
|
|
|
|
word = desc;
|
|
|
|
}
|
|
|
|
}
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
ppc64_sysv_abi_push_integer (gdbarch, word, argpos);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos);
|
|
|
|
|
|
|
|
/* The ABI (version 1.9) specifies that structs containing a
|
|
|
|
single floating-point value, at any level of nesting of
|
|
|
|
single-member structs, are passed in floating-point registers. */
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
|
|
|
&& TYPE_NFIELDS (type) == 1)
|
2013-04-01 06:05:35 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
while (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
|
|
|
&& TYPE_NFIELDS (type) == 1)
|
|
|
|
type = check_typedef (TYPE_FIELD_TYPE (type, 0));
|
|
|
|
|
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
|
|
|
ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos);
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
2014-02-04 18:42:35 +01:00
|
|
|
|
|
|
|
/* In the ELFv2 ABI, homogeneous floating-point or vector
|
|
|
|
aggregates are passed in a series of registers. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V2)
|
|
|
|
{
|
|
|
|
struct type *eltype;
|
|
|
|
int i, nelt;
|
|
|
|
|
|
|
|
if (ppc64_elfv2_abi_homogeneous_aggregate (type, &eltype, &nelt))
|
|
|
|
for (i = 0; i < nelt; i++)
|
|
|
|
{
|
|
|
|
const gdb_byte *elval = val + i * TYPE_LENGTH (eltype);
|
|
|
|
|
|
|
|
if (TYPE_CODE (eltype) == TYPE_CODE_FLT
|
|
|
|
|| TYPE_CODE (eltype) == TYPE_CODE_DECFLOAT)
|
|
|
|
ppc64_sysv_abi_push_freg (gdbarch, eltype, elval, argpos);
|
|
|
|
else if (TYPE_CODE (eltype) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_VECTOR (eltype)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
|
|
|
|
&& TYPE_LENGTH (eltype) == 16)
|
|
|
|
ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
|
|
|
|
}
|
|
|
|
}
|
2013-04-01 06:05:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-10 21:38:51 +01:00
|
|
|
/* Pass the arguments in either registers, or in the stack. Using the
|
2003-10-10 20:29:13 +02:00
|
|
|
ppc 64 bit SysV ABI.
|
|
|
|
|
|
|
|
This implements a dumbed down version of the ABI. It always writes
|
|
|
|
values to memory, GPR and FPR, even when not necessary. Doing this
|
2011-01-10 21:38:51 +01:00
|
|
|
greatly simplifies the logic. */
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
CORE_ADDR
|
2011-01-10 21:38:51 +01:00
|
|
|
ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
|
|
|
|
struct value *function,
|
2003-10-10 20:29:13 +02:00
|
|
|
struct regcache *regcache, CORE_ADDR bp_addr,
|
|
|
|
int nargs, struct value **args, CORE_ADDR sp,
|
|
|
|
int struct_return, CORE_ADDR struct_addr)
|
|
|
|
{
|
2004-06-07 04:02:55 +02:00
|
|
|
CORE_ADDR func_addr = find_function_addr (function, NULL);
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
2011-10-26 19:21:53 +02:00
|
|
|
int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
|
2007-05-13 14:27:30 +02:00
|
|
|
ULONGEST back_chain;
|
2003-10-10 20:29:13 +02:00
|
|
|
/* See for-loop comment below. */
|
|
|
|
int write_pass;
|
2011-03-15 15:42:34 +01:00
|
|
|
/* Size of the by-reference parameter copy region, the final value is
|
|
|
|
computed in the for-loop below. */
|
|
|
|
LONGEST refparam_size = 0;
|
2003-10-10 20:29:13 +02:00
|
|
|
/* Size of the general parameter region, the final value is computed
|
|
|
|
in the for-loop below. */
|
|
|
|
LONGEST gparam_size = 0;
|
|
|
|
/* Kevin writes ... I don't mind seeing tdep->wordsize used in the
|
2011-01-10 21:38:51 +01:00
|
|
|
calls to align_up(), align_down(), etc. because this makes it
|
2003-10-10 20:29:13 +02:00
|
|
|
easier to reuse this code (in a copy/paste sense) in the future,
|
|
|
|
but it is a 64-bit ABI and asserting that the wordsize is 8 bytes
|
|
|
|
at some point makes it easier to verify that this function is
|
|
|
|
correct without having to do a non-local analysis to figure out
|
|
|
|
the possible values of tdep->wordsize. */
|
|
|
|
gdb_assert (tdep->wordsize == 8);
|
|
|
|
|
2007-10-30 20:35:35 +01:00
|
|
|
/* This function exists to support a calling convention that
|
|
|
|
requires floating-point registers. It shouldn't be used on
|
|
|
|
processors that lack them. */
|
|
|
|
gdb_assert (ppc_floating_point_unit_p (gdbarch));
|
|
|
|
|
2007-05-13 14:27:30 +02:00
|
|
|
/* By this stage in the proceedings, SP has been decremented by "red
|
|
|
|
zone size" + "struct return size". Fetch the stack-pointer from
|
|
|
|
before this and use that as the BACK_CHAIN. */
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
regcache_cooked_read_unsigned (regcache, gdbarch_sp_regnum (gdbarch),
|
2007-06-18 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (SP_REGNUM): Replace by gdbarch_sp_regnum.
* v850-tdep.c (v850_unwind_sp): Likewise.
* std-regs.c (value_of_builtin_frame_sp_reg): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh-tdep.c (sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu)
(sh_dwarf2_frame_init_reg, sh_frame_cache, sh_frame_prev_register)
(sh_unwind_sp): Likewise.
* sh64-tdep.c (sh64_push_dummy_call, sh64_frame_cache)
(sh64_frame_prev_register, sh64_unwind_sp): Likewise.
* rs6000-tdep.c (rs6000_push_dummy_call, rs6000_unwind_dummy_id)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (store_register): Likewise.
* remote-mips.c (mips_wait): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* m32r-rom.c (m32r_supply_register): Likewise.
* frame.c (frame_sp_unwind): Likewise.
* mips-tdep.c (mips_insn16_frame_cache)
(mips_insn32_frame_cache): Likewise (comment).
* m68klinux-nat.c (supply_gregset): Likewise.
* m68k-tdep.c (m68k_get_longjmp_target): Likewise.
* ia64-tdep.c (ia64_frame_prev_register): Likewise.
* i386-tdep.c (i386_get_longjmp_target): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* cris-tdep.c (cris_regnums, cris_sigcontext_addr)
(cris_sigtramp_frame_unwind_cache, cris_push_dummy_call)
(cris_scan_prologue, crisv32_scan_prologue, cris_unwind_sp)
(cris_register_type, crisv32_register_type)
(cris_dwarf2_frame_init_reg): Likewise.
* arch-utils.c (legacy_virtual_frame_pointer): Likewise.
* amd64-tdep.c (amd64_frame_prev_register): Likewise.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise.
* libunwind-frame.c (libunwind_frame_cache): Likewise.
* gdbarch.sh (PC_REGNUM): Replace by gdbarch_pc_regnum.
* regcache.c (read_pc_pid, generic_target_write_pc): Likewise.
* xtensa-tdep.c (xtensa_register_type, xtensa_supply_gregset)
(xtensa_unwind_pc, xtensa_frame_cache, xtensa_frame_prev_register)
(xtensa_extract_return_value, xtensa_store_return_value): Likewise.
* v850-tdep.c (v850_unwind_pc): Likewise.
* stack.c (frame_info): Likewise.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs)
(sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs)
(sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs)
(sh_dwarf2_frame_init_reg, sh_frame_prev_register, sh_unwind_pc)
(sh_dsp_show_regs): Likewise.
* shnbsd-tdep.c (shnbsd_supply_gregset)
(shnbsd_collect_gregset): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Likewise.
* sh64-tdep.c (sh64_compact_reg_base_num, sh64_show_media_regs)
(sh64_frame_prev_register, sh64_unwind_pc): Likewise.
* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset)
(6000_register_reggroup_p, rs6000_unwind_pc)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (regmap, rs6000_fetch_inferior_registers)
(rs6000_store_inferior_registers): Likewise.
* remote-mips.c (mips_wait, mips_load): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcnbsd-nat.c (getregs_supplies, ppcnbsd_supply_pcb): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_ppc_registers)
(store_ppc_registers, fill_gregset): Likewise.
* mips-tdep.c (mips_stub_frame_cache, mips_gdbarch_init): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_fill_reg): Likewise.
* mipsnbsd-nat.c (getregs_supplies): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* irix5-nat.c (fill_gregset): Likewise.
* i386-tdep.c (i386_unwind_pc): Likewise.
* i386-linux-nat.c (i386_linux_resume): Likewise.
* frame.c (get_prev_frame_1): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* dbug-rom.c (dbug_supply_register): Likewise.
* cris-tdep.c (cris_sigtramp_frame_unwind_cache, cris_scan_prologue)
(crisv32_scan_prologue, cris_unwind_pc, cris_register_size)
(cris_register_type, crisv32_register_type, crisv32_register_name)
(cris_dwarf2_frame_init_reg, find_step_target)
(cris_software_single_step, cris_supply_gregset)
(cris_regnums): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* aix-thread.c (special_register_p, supply_sprs64, supply_sprs32)
(fill_sprs64, fill_sprs32, store_regs_user_thread): Likewise.
* mips-linux-tdep.c (mips_linux_write_pc): Likewise.
* gdbarch.sh (PS_REGNUM): Replace by gdbarch_ps_regnum.
* dbug-rom.c (dbug_supply_register): Likewise.
* xtensa-tdep.c (xtensa_supply_gregset, xtensa_frame_cache)
(xtensa_frame_prev_register, xtensa_push_dummy_call): Likewise.
* win32-nat.c (win32_resume): Likewise.
* std-regs.c (value_of_builtin_frame_ps_reg)
(value_of_builtin_frame_pc_reg): Likewise.
* m68k-tdep.c (m68k_register_type): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* gdbarch.sh (FP0_REGNUM): Replace by gdbarch_fp0_regnum.
* sh-tdep.c (sh_extract_return_value_fpu, sh_store_return_value_fpu)
(sh2e_show_regs, sh2a_show_regs, sh3e_show_regs, sh4_show_regs)
(sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_register_type)
(fv_reg_base_num, dr_reg_base_num): Likewise.
* sh64-tdep.c (sh64_fv_reg_base_num, sh64_dr_reg_base_num)
(sh64_fpp_reg_base_num, sh64_compact_reg_base_num, sh64_push_dummy_call)
(sh64_extract_return_value, sh64_store_return_value)
(sh64_show_media_regs, sh64_show_compact_regs, sh64_register_type)
(sh64_do_fp_register, sh64_media_print_registers_info): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers)
(invalidate_cache): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_fpreg)
(mipsnbsd_fill_fpreg): Likewise.
* mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers)
(mipsnbsd_store_inferior_registers): Likewise.
* mips-linux-tdep.c (mips_supply_fpregset, mips_fill_fpregset)
(mips64_supply_fpregset, mips64_fill_fpregset): Likewise.
* mips-linux-nat.c (mips64_linux_register_addr): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_convert_register_p): Likewise.
* m68klinux-nat.c (getfpregs_supplies, supply_fpregset)
(fill_fpregset): Likewise.
* irix5-nat.c (supply_fpregset, fill_fpregset): Likewise.
* i386-tdep.h (struct_return): Likewise (comment).
* i386-nto-tdep.c (i386nto_register_area): Likewise.
* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
(go32_store_registers): Likewise.
* alpha-tdep.c (alpha_next_pc): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* alphabsd-nat.c (alphabsd_fetch_inferior_registers)
(alphabsd_store_inferior_registers): Likewise.
* core-regset.c (fetch_core_registers): Likewise.
* i386v4-nat.c (supply_fpregset, fill_fpregset): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
2007-06-18 19:45:26 +02:00
|
|
|
&back_chain);
|
2007-05-13 14:27:30 +02:00
|
|
|
|
2003-10-10 20:29:13 +02:00
|
|
|
/* Go through the argument list twice.
|
|
|
|
|
|
|
|
Pass 1: Compute the function call's stack space and register
|
|
|
|
requirements.
|
|
|
|
|
|
|
|
Pass 2: Replay the same computation but this time also write the
|
|
|
|
values out to the target. */
|
|
|
|
|
|
|
|
for (write_pass = 0; write_pass < 2; write_pass++)
|
|
|
|
{
|
|
|
|
int argno;
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
struct ppc64_sysv_argpos argpos;
|
|
|
|
argpos.greg = 3;
|
|
|
|
argpos.freg = 1;
|
|
|
|
argpos.vreg = 2;
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
if (!write_pass)
|
|
|
|
{
|
2011-03-15 15:42:34 +01:00
|
|
|
/* During the first pass, GPARAM and REFPARAM are more like
|
|
|
|
offsets (start address zero) than addresses. That way
|
|
|
|
they accumulate the total stack space each region
|
|
|
|
requires. */
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
argpos.regcache = NULL;
|
|
|
|
argpos.gparam = 0;
|
|
|
|
argpos.refparam = 0;
|
2003-10-10 20:29:13 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-15 15:42:34 +01:00
|
|
|
/* Decrement the stack pointer making space for the Altivec
|
|
|
|
and general on-stack parameters. Set refparam and gparam
|
|
|
|
to their corresponding regions. */
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
argpos.regcache = regcache;
|
|
|
|
argpos.refparam = align_down (sp - refparam_size, 16);
|
|
|
|
argpos.gparam = align_down (argpos.refparam - gparam_size, 16);
|
2014-02-04 18:41:36 +01:00
|
|
|
/* Add in space for the TOC, link editor double word (v1 only),
|
|
|
|
compiler double word (v1 only), LR save area, CR save area,
|
|
|
|
and backchain. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V1)
|
|
|
|
sp = align_down (argpos.gparam - 48, 16);
|
|
|
|
else
|
|
|
|
sp = align_down (argpos.gparam - 32, 16);
|
2003-10-10 20:29:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If the function is returning a `struct', then there is an
|
|
|
|
extra hidden parameter (which will be passed in r3)
|
|
|
|
containing the address of that struct.. In that case we
|
|
|
|
should advance one word and start from r4 register to copy
|
|
|
|
parameters. This also consumes one on-stack parameter slot. */
|
|
|
|
if (struct_return)
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ppc64_sysv_abi_push_integer (gdbarch, struct_addr, &argpos);
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
for (argno = 0; argno < nargs; argno++)
|
|
|
|
{
|
|
|
|
struct value *arg = args[argno];
|
2004-11-12 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_TYPE, VALUE_NEXT, VALUE_OFFSET, VALUE_BITSIZE)
(VALUE_BITPOS): Delete.
(value_type, value_offset, value_bitsize, value_bitpos): Declare.
* value.c (value_type, value_offset, value_bitpos)
(value_bitsize): New functions. Update references.
* arm-tdep.c, gnu-v3-abi.c, hpacc-abi.c, gnu-v2-abi.c: Update.
* f-valprint.c, cp-valprint.c, c-valprint.c: Update.
* ada-valprint.c, typeprint.c, scm-valprint.c, scm-exp.c: Update.
* p-valprint.c, jv-valprint.c, jv-lang.c, varobj.c: Update.
* objc-lang.c, ada-lang.c, std-regs.c, stack.c: Update.
* infcall.c, linespec.c, printcmd.c, valarith.c: Update.
* valops.c, eval.c, findvar.c, breakpoint.c: Update.
* tracepoint.c, ax-gdb.c, mi/mi-main.c, cli/cli-dump.c:
* rs6000-tdep.c, ppc-sysv-tdep.c: Update.
2004-11-12 22:45:08 +01:00
|
|
|
struct type *type = check_typedef (value_type (arg));
|
2005-02-06 Andrew Cagney <cagney@gnu.org>
* value.c (value_contents, value_contents_writeable): New
functions.
* value.h (VALUE_CONTENTS): Delete macro.
(value_contents, value_contents_writeable): Declare.
* xstormy16-tdep.c, value.c, valops.c, valarith.c: Update.
* stack.c, sparc-tdep.c, sparc64-tdep.c, sh-tdep.c: Update.
* sh64-tdep.c, scm-valprint.c, scm-exp.c, s390-tdep.c: Update.
* rs6000-tdep.c, p-valprint.c, printcmd.c: Update.
* ppc-sysv-tdep.c, mips-tdep.c, mi/mi-main.c: Update.
* m88k-tdep.c, m68hc11-tdep.c, m32r-tdep.c: Update.
* jv-valprint.c, ia64-tdep.c, hppa-tdep.c: Update.
* hpacc-abi.c, f-valprint.c, frv-tdep.c, eval.c: Update.
* c-valprint.c, cris-tdep.c, cp-valprint.c: Update.
* cli/cli-dump.c, breakpoint.c, avr-tdep.c, arm-tdep.c: Update.
* arm-linux-tdep.c, amd64-tdep.c, alpha-tdep.c: Update.
* ada-valprint.c, ada-lang.c: Update.
2005-02-07 01:09:56 +01:00
|
|
|
const bfd_byte *val = value_contents (arg);
|
2008-02-01 16:04:18 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (TYPE_CODE (type) == TYPE_CODE_COMPLEX)
|
2003-10-10 20:29:13 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Complex types are passed as if two independent scalars. */
|
|
|
|
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
|
2008-01-30 04:18:39 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ppc64_sysv_abi_push_param (gdbarch, eltype, val, &argpos);
|
|
|
|
ppc64_sysv_abi_push_param (gdbarch, eltype,
|
|
|
|
val + TYPE_LENGTH (eltype), &argpos);
|
2008-01-30 04:18:39 +01:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
2011-02-08 14:30:10 +01:00
|
|
|
&& opencl_abi)
|
|
|
|
{
|
|
|
|
/* OpenCL vectors shorter than 16 bytes are passed as if
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
a series of independent scalars; OpenCL vectors 16 bytes
|
|
|
|
or longer are passed as if a series of AltiVec vectors. */
|
|
|
|
struct type *eltype;
|
|
|
|
int i, nelt;
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (TYPE_LENGTH (type) < 16)
|
|
|
|
eltype = check_typedef (TYPE_TARGET_TYPE (type));
|
|
|
|
else
|
|
|
|
eltype = register_type (gdbarch, tdep->ppc_vr0_regnum);
|
|
|
|
|
|
|
|
nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype);
|
2011-02-08 14:30:10 +01:00
|
|
|
for (i = 0; i < nelt; i++)
|
|
|
|
{
|
|
|
|
const gdb_byte *elval = val + i * TYPE_LENGTH (eltype);
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ppc64_sysv_abi_push_param (gdbarch, eltype, elval, &argpos);
|
2003-10-10 20:29:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* All other types are passed as single arguments. */
|
|
|
|
ppc64_sysv_abi_push_param (gdbarch, type, val, &argpos);
|
2003-10-10 20:29:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!write_pass)
|
|
|
|
{
|
2011-03-15 15:42:34 +01:00
|
|
|
/* Save the true region sizes ready for the second pass. */
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
refparam_size = argpos.refparam;
|
2011-03-15 15:42:34 +01:00
|
|
|
/* Make certain that the general parameter save area is at
|
2003-10-10 20:29:13 +02:00
|
|
|
least the minimum 8 registers (or doublewords) in size. */
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (argpos.greg < 8)
|
2003-10-10 20:29:13 +02:00
|
|
|
gparam_size = 8 * tdep->wordsize;
|
|
|
|
else
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
gparam_size = argpos.gparam;
|
2003-10-10 20:29:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Update %sp. */
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 05:53:46 +01:00
|
|
|
regcache_cooked_write_signed (regcache, gdbarch_sp_regnum (gdbarch), sp);
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
/* Write the backchain (it occupies WORDSIZED bytes). */
|
* defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
* gdbcore.h (read_memory_integer, safe_read_memory_integer,
read_memory_unsigned_integer, write_memory_signed_integer,
write_memory_unsigned_integer): Add BYTE_ORDER parameter.
* corefile.c (struct captured_read_memory_integer_arguments): Add
BYTE_ORDER member.
(safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into
struct captured_read_memory_integer_arguments.
(do_captured_read_memory_integer): Pass it to read_memory_integer.
(read_memory_integer): Add BYTE_ORDER parameter. Pass it to
extract_signed_integer.
(read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to
extract_unsigned_integer.
(write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it
to store_signed_integer.
(write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it
to store_unsigned_integer.
* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
Pass it to extract_unsigned_integer.
Update calls to extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
store_unsigned_integer, read_memory_integer,
read_memory_unsigned_integer, safe_read_memory_integer,
write_memory_signed_integer, write_memory_unsigned_integer, and
get_target_memory_unsigned to pass byte order:
* ada-lang.c (ada_value_binop): Update.
* ada-valprint.c (char_at): Update.
* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
alpha_extract_return_value, alpha_read_insn,
alpha_get_longjmp_target): Update.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
* amd64obsd-tdep.c (amd64obsd_supply_uthread,
amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
amd64_displaced_step_fixup): Update.
* arm-linux-tdep.c (arm_linux_sigreturn_init,
arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
arm_return_value): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
* auxv.c (default_auxv_parse): Update.
* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
avr_scan_prologue, avr_extract_return_value,
avr_frame_prev_register, avr_push_dummy_call): Update.
* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
bsd_uthread_wait, bsd_uthread_thread_alive,
bsd_uthread_extra_thread_info): Update.
* c-lang.c (c_printstr, print_wchar): Update.
* cp-valprint.c (cp_print_class_member): Update.
* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
cris_extract_return_value, find_step_target, dip_prefix,
sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
move_mem_to_reg_movem_op, get_data_from_address): Update.
* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
* dwarf2-frame.c (execute_cfa_program): Update.
* dwarf2loc.c (find_location_expression): Update.
* dwarf2read.c (dwarf2_const_value): Update.
* expprint.c (print_subexp_standard): Update.
* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
unsigned_address_to_pointer, address_to_signed_pointer,
read_var_value): Update.
* frame.c (frame_unwind_register_signed,
frame_unwind_register_unsigned, get_frame_memory_signed,
get_frame_memory_unsigned): Update.
* frame-unwind.c (frame_unwind_got_constant): Update.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Update.
* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
frv_extract_return_value, find_func_descr,
frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
* f-valprint.c (f_val_print): Update.
* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
Update.
* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
h8300_push_dummy_call, h8300_extract_return_value,
h8300h_extract_return_value, h8300_store_return_value,
h8300h_store_return_value): Update.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
hppa64_hpux_in_solib_call_trampoline,
hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
hppa_hpux_sigtramp_frame_unwind_cache,
hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
hppa32_hpux_search_dummy_call_sequence,
hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
hppa_hpux_unwind_adjust_stub): Update.
* hppa-linux-tdep.c (insns_match_pattern,
hppa_linux_find_global_pointer): Update.
* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
hppa_pseudo_register_read, hppa_frame_prev_register_helper,
hppa_match_insns): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* i386-tdep.c (i386bsd_sigcontext_addr): Update.
* i386-cygwin-tdep.c (core_process_module_section): Update.
* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
amd64_darwin_sstep_at_sigreturn): Update.
* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
amd64_darwin_sigcontext_addr): Likewise.
* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
* i386obsd-nat.c (i386obsd_supply_pcb): Update.
* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
i386obsd_trapframe_cache): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
i386_analyze_frame_setup, i386_analyze_prologue,
i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
i386_get_longjmp_target, i386_push_dummy_call,
i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
i386_fetch_pointer_argument): Update.
* i387-tdep.c (i387_supply_fsave): Update.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
ia64_libunwind_frame_prev_register,
ia64_libunwind_sigtramp_frame_this_id,
ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
find_extant_func_descr, find_func_descr,
ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
ia64_unwind_pc): Update.
* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
iq2000_scan_prologue, iq2000_extract_return_value,
iq2000_push_dummy_call): Update.
* irix5nat.c (fill_gregset): Update.
* jv-lang.c (evaluate_subexp_java): Update.
* jv-valprint.c (java_value_print): Update.
* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
lm32_extract_return_value, lm32_store_return_value): Update.
* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_store_return_value, decode_prologue,
m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
Update.
* m68hc11-tdep.c (m68hc11_pseudo_register_read,
m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
m68hc11_push_dummy_call): Update.
* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
Update.
* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
m68k_get_longjmp_target): Update.
* m88k-tdep.c (m88k_fetch_instruction): Update.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
* mi/mi-main.c (mi_cmd_data_write_memory): Update.
* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
mips64_linux_get_longjmp_target, mips64_fill_gregset,
mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
mips_o32_push_dummy_call, mips_o64_push_dummy_call,
mips_single_step_through_delay, mips_skip_pic_trampoline_code,
mips_integer_to_address): Update.
* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
Update.
* monitor.c (monitor_supply_register, monitor_write_memory,
monitor_read_memory_single): Update.
* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
moxie_analyze_prologue): Update.
* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
mt_push_dummy_call): Update.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class, find_implementation_from_class): Update.
* ppc64-linux-tdep.c (ppc64_desc_entry_point,
ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
Update.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
ppcobsd_sigtramp_frame_cache): Update.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
ppc64_sysv_abi_return_value): Update.
* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
* procfs.c (procfs_auxv_parse): Update.
* p-valprint.c (pascal_val_print): Update.
* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
regcache_raw_write_signed, regcache_raw_write_unsigned,
regcache_cooked_read_signed, regcache_cooked_read_unsigned,
regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
Update.
* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
rs6000_convert_from_func_ptr_addr, branch_dest,
rs6000_software_single_step): Update.
* rs6000-tdep.c (rs6000_in_function_epilogue_p,
ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
rs6000_frame_cache): Update.
* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
* scm-exp.c (scm_lreadr): Update.
* scm-lang.c (scm_get_field, scm_unpack): Update.
* scm-valprint.c (scm_val_print): Update.
* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
score_fetch_inst): Update.
* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
sh64_pseudo_register_read, sh64_pseudo_register_write,
sh64_frame_prev_register): Update:
* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
* solib-darwin.c (darwin_load_image_infos): Update.
* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
find_canonical_descriptor_in_load_object): Update.
* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
irix_open_symbol_file_object): Update.
* solib-som.c (som_solib_create_inferior_hook, link_map_start,
som_current_sos, som_open_symbol_file_object): Update.
* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
Update.
* solib-svr4.c (read_program_header, scan_dyntag_auxv,
solib_svr4_r_ldsomap): Update.
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Update.
* sparc64-tdep.c (sparc64_pseudo_register_read,
sparc64_pseudo_register_write, sparc64_supply_gregset,
sparc64_collect_gregset): Update.
* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Update.
* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
sparc_collect_rwindow): Update.
* spu-linux-nat.c (parse_spufs_run): Update.
* spu-tdep.c (spu_pseudo_register_read_spu,
spu_pseudo_register_write_spu, spu_pointer_to_address,
spu_analyze_prologue, spu_in_function_epilogue_p,
spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
info_spu_dma_command, info_spu_proxydma_command): Update.
* stack.c (print_frame_nameless_args, frame_info): Update.
* symfile.c (read_target_long_array, simple_read_overlay_table,
simple_read_overlay_region_table): Update.
* target.c (debug_print_register): Update.
* tramp-frame.c (tramp_frame_start): Update.
* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
v850_extract_return_value, v850_store_return_value,
* valarith.c (value_binop, value_bit_index): Update.
* valops.c (value_cast): Update.
* valprint.c (val_print_type_code_int, val_print_string,
read_string): Update.
* value.c (unpack_long, unpack_double, unpack_field_as_long,
modify_field, pack_long): Update.
* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
vax_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_push_dummy_call,
xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
xtensa_pseudo_register_write, xtensa_frame_cache,
xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.
* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
BYTE_ORDER parameter.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
* dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it
instead of current_gdbarch.
(decimal_to_string, decimal_from_integral, decimal_from_floating,
decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
Pass it to match_endianness.
(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
parameters. Pass them to match_endianness.
(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
Pass them to match_endianness.
(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
Pass them to match_endianness.
* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
BYTE_ORDER_Y output parameters.
(value_binop): Update call to value_args_as_decimal.
Update calls to decimal_to_string, decimal_from_string,
decimal_from_integral, decimal_from_floating, decimal_to_doublest,
decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
to pass/receive byte order:
* c-exp.y (parse_number): Update.
* printcmd.c (printf_command): Update.
* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
value_equal, value_less): Update.
* valops.c (value_cast, value_one): Update.
* valprint.c (print_decimal_floating): Update.
* value.c (unpack_long, unpack_double): Update.
* python/python-value.c (valpy_nonzero): Update.
* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
(printstr): Update calls to char_at.
(ada_val_print_array): Likewise.
* valprint.c (read_string): Add BYTE_ORDER parameter.
(val_print_string): Update call to read_string.
* c-lang.c (c_get_string): Likewise.
* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
Use it instead of current_gdbarch.
* printcmd.c (printf_command): Update calls to target_wide_charset.
* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
Pass to target_wide_charset. Use it instead of current_gdbarch.
(classify_type): Add BYTE_ORDER parameter. Pass to
charset_for_string_type. Allow NULL encoding pointer.
(print_wchar): Add BYTE_ORDER parameter.
(c_emit_char): Update calls to classify_type and print_wchar.
(c_printchar, c_printstr): Likewise.
* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
parameter.
* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
(rs6000_skip_trampoline_code): Update call.
* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
(alpha_read_insn): Add GDBARCH parameter.
* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
(alpha_register_to_value): Pass architecture to alpha_sts.
(alpha_extract_return_value): Likewise.
(alpha_value_to_register): Pass architecture to alpha_lds.
(alpha_store_return_value): Likewise.
(alpha_read_insn): Add GDBARCH parameter.
(alpha_skip_prologue): Pass architecture to alpha_read_insn.
(alpha_heuristic_proc_start): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_next_pc): Likewise.
(alpha_sigtramp_frame_this_id): Pass architecture to
tdep->dynamic_sigtramp_offset callback.
(alpha_sigtramp_frame_sniffer): Pass architecture to
tdep->pc_in_sigtramp callback.
* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
(alphafbsd_sigtramp_offset): Likewise.
* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
parameter. Pass to alpha_read_insn.
(alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset_1.
(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_linux_sigtramp_offset.
(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
and alpha_linux_sigtramp_offset.
* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alphanbsd_sigtramp_offset.
* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to
alpha_read_insn.
(alphaobsd_sigcontext_addr): Pass architecture to
alphaobsd_sigtramp_offset.
* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
parameter.
* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
(amd64_frame_cache): Likewise.
* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
* arm-wince-tdep.c: Include "frame.h".
* avr-tdep.c (EXTRACT_INSN): Remove.
(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
(avr_skip_prologue): Pass architecture to avr_scan_prologue.
(avr_frame_unwind_cache): Likewise.
* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
(find_step_target): Initialize it.
(get_data_from_address): Add BYTE_ORDER parameter.
(bdap_prefix): Pass byte order to get_data_from_address.
(handle_prefix_assign_mode_for_aritm_op): Likewise.
(three_operand_add_sub_cmp_and_or_op): Likewise.
(handle_inc_and_index_mode_for_aritm_op): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
(frv_linux_sigcontext_reg_addr): Pass architecture to
frv_linux_pc_in_sigtramp.
(frv_linux_sigtramp_frame_sniffer): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
(h8300_analyze_prologue): Add GDBARCH parameter. Pass to
h8300_is_argument_spill.
(h8300_frame_cache, h8300_skip_prologue): Pass architecture
to h8300_analyze_prologue.
* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
in_solib_call_trampoline callback.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
parameter.
(hppa64_push_dummy_call): Pass architecture to
hppa64_convert_code_addr_to_fptr.
(hppa_match_insns): Add GDBARCH parameter.
(hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to
hppa_match_insns.
(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
(hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to
hppa_match_insns_relaxed.
(hppa_stub_unwind_sniffer): Pass architecture to
tdep->in_solib_call_trampoline callback.
* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
hppa_hpux_search_pattern.
* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
Pass to insns_match_pattern.
(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
hppa_linux_sigtramp_find_sigcontext.
(hppa_linux_sigtramp_frame_sniffer): Likewise.
(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
(hppa64_hpux_in_solib_call_trampoline): Likewise.
* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
(i386_analyze_frame_setup): Add GDBARCH parameter.
(i386_analyze_prologue): Add GDBARCH parameter. Pass to
i386_follow_jump and i386_analyze_frame_setup.
(i386_skip_prologue): Pass architecture to i386_analyze_prologue
and i386_follow_jump.
(i386_frame_cache): Pass architecture to i386_analyze_prologue.
(i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
frame to i386_pe_skip_trampoline_code.
* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
to sigcontext_register_address callback.
* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
(ia64_find_unwind_table): Pass architecture to
ia64_find_global_pointer.
(find_extant_func_descr): Add GDBARCH parameter.
(find_func_descr): Pass architecture to find_extant_func_descr
and ia64_find_global_pointer.
(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
tdep->sigcontext_register_address callback.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
GDBARCH parameter.
* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.
* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
lm32_analyze_prologue.
* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
(m32r_skip_prologue): Pass architecture to decode_prologue.
* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
(m68hc11_scan_prologue): Pass architecture to
m68hc11_analyze_instruction.
* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
(m68k_analyze_prologue): Pass architecture to
m68k_analyze_frame_setup.
* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
(m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order
to m88k_fetch_instruction.
(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
(m88k_frame_cache): Likewise.
* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
(mep_analyze_prologue): Pass architecture to mep_get_insn.
* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
(mips32_next_pc): Pass architecture to mips_fetch_instruction.
(deal_with_atomic_sequence): Likewise.
(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
(mips16_scan_prologue): Likewise.
(mips32_scan_prologue): Likewise.
(mips16_in_function_epilogue_p): Likewise.
(mips32_in_function_epilogue_p): Likewise.
(mips_about_to_return): Likewise.
(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
(mips_skip_prologue): Pass architecture to mips16_scan_prologue
and mips32_scan_prologue.
(mips_in_function_epilogue_p): Pass architecture to
mips16_in_function_epilogue_p and
mips32_in_function_epilogue_p.
(heuristic_proc_start): Pass architecture to mips_fetch_instruction
and mips_about_to_return.
(mips_skip_mips16_trampoline_code): Pass architecture to
mips_fetch_instruction.
(fetch_mips_16): Add GDBARCH parameter.
(mips16_next_pc): Pass architecture to fetch_mips_16.
(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
fetch_mips_16.
* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
read_objc_methlist_method, read_objc_object, read_objc_super,
read_objc_class): Add GDBARCH parameter.
(find_implementation_from_class): Add GDBARCH parameter, pass
to read_objc_class, read_objc_methlist_nmethods, and
read_objc_methlist_method.
(find_implementation): Add GDBARCH parameter, pass to
read_objc_object and find_implementation_from_class.
(resolve_msgsend, resolve_msgsend_stret): Pass architecture
to find_implementation.
(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
architecture to read_objc_super and find_implementation_from_class.
* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
ppc64_standard_linkage3_target): Pass architecture to
ppc64_desc_entry_point.
* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
(rs6000_fetch_instruction): Add GDBARCH parameter.
(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
rs6000_fetch_instruction.
(skip_prologue): Pass architecture to rs6000_fetch_instruction.
* remote-mips.c (mips_store_word): Return old_contents as host
integer value instead of target bytes.
* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
(s390_analyze_prologue): Initialize it.
(extend_simple_arg): Add GDBARCH parameter.
(s390_push_dummy_call): Pass architecture to extend_simple_arg.
* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
* scm-valprint.c (scm_scmval_print): Likewise.
(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
SCM_BYTE_ORDER.
* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
look_for_args_moves.
(sh64_skip_prologue): Pass architecture to
sh64_skip_prologue_hard_way.
* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
(sh_frame_cache): Likewise.
* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
Pass architecture to extract_mips_address.
* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
to sparc_fetch_wcookie.
(sparc32_frame_prev_register): Likewise.
* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
(spu_virtual_frame_pointer): Likewise.
(spu_frame_unwind_cache): Likewise.
(info_spu_mailbox_list): Add BYTE_ORER parameter.
(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
to info_spu_dma_cmdlist.
* symfile.c (read_target_long_array): Add GDBARCH parameter.
(simple_read_overlay_table, simple_read_overlay_region_table,
simple_overlay_update_1): Pass architecture to read_target_long_array.
* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
(v850_frame_cache): Pass architecture to v850_analyze_prologue.
* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
parameter.
(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
to xstormy16_analyze_prologue.
(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
(xstormy16_find_jmp_table_entry): Likewise.
(xstormy16_skip_trampoline_code): Pass architecture to
xstormy16_resolve_jmp_table_entry.
(xstormy16_pointer_to_address): Likewise.
(xstormy16_address_to_pointer): Pass architecture to
xstormy16_find_jmp_table_entry.
* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
(call0_analyze_prologue): Add GDBARCH parameter, pass to
call0_track_op.
(call0_frame_cache): Pass architecture to call0_analyze_prologue.
(xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
|
|
|
write_memory_signed_integer (sp, tdep->wordsize, byte_order, back_chain);
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
/* Point the inferior function call's return address at the dummy's
|
|
|
|
breakpoint. */
|
|
|
|
regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
|
|
|
|
|
2014-02-04 18:40:16 +01:00
|
|
|
/* In the ELFv1 ABI, use the func_addr to find the descriptor, and use
|
|
|
|
that to find the TOC. If we're calling via a function pointer,
|
|
|
|
the pointer itself identifies the descriptor. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V1)
|
|
|
|
{
|
|
|
|
struct type *ftype = check_typedef (value_type (function));
|
|
|
|
CORE_ADDR desc_addr = value_as_address (function);
|
|
|
|
|
|
|
|
if (TYPE_CODE (ftype) == TYPE_CODE_PTR
|
|
|
|
|| convert_code_addr_to_desc_addr (func_addr, &desc_addr))
|
|
|
|
{
|
|
|
|
/* The TOC is the second double word in the descriptor. */
|
|
|
|
CORE_ADDR toc =
|
|
|
|
read_memory_unsigned_integer (desc_addr + tdep->wordsize,
|
|
|
|
tdep->wordsize, byte_order);
|
|
|
|
|
|
|
|
regcache_cooked_write_unsigned (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + 2, toc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* In the ELFv2 ABI, we need to pass the target address in r12 since
|
|
|
|
we may be calling a global entry point. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V2)
|
|
|
|
regcache_cooked_write_unsigned (regcache,
|
|
|
|
tdep->ppc_gp0_regnum + 12, func_addr);
|
2003-10-10 20:29:13 +02:00
|
|
|
|
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Subroutine of ppc64_sysv_abi_return_value that handles "base" types:
|
|
|
|
integer, floating-point, and AltiVec vector types.
|
2003-10-03 23:11:39 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
This routine also handles components of aggregate return types;
|
|
|
|
INDEX describes which part of the aggregate is to be handled.
|
2003-10-03 23:11:39 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
Returns true if VALTYPE is some such base type that could be handled,
|
|
|
|
false otherwise. */
|
|
|
|
static int
|
|
|
|
ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
|
|
|
|
struct regcache *regcache, gdb_byte *readbuf,
|
|
|
|
const gdb_byte *writebuf, int index)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
2003-11-07 21:44:51 +01:00
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
2004-05-07 22:48:43 +02:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Integers live in GPRs starting at r3. */
|
2005-02-09 17:51:43 +01:00
|
|
|
if ((TYPE_CODE (valtype) == TYPE_CODE_INT
|
2008-05-03 01:24:44 +02:00
|
|
|
|| TYPE_CODE (valtype) == TYPE_CODE_ENUM
|
|
|
|
|| TYPE_CODE (valtype) == TYPE_CODE_CHAR
|
|
|
|
|| TYPE_CODE (valtype) == TYPE_CODE_BOOL)
|
2005-02-09 17:51:43 +01:00
|
|
|
&& TYPE_LENGTH (valtype) <= 8)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_gp0_regnum + 3 + index;
|
|
|
|
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf != NULL)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
|
|
|
/* Be careful to sign extend the value. */
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
regcache_cooked_write_unsigned (regcache, regnum,
|
2003-11-10 23:47:31 +01:00
|
|
|
unpack_long (valtype, writebuf));
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf != NULL)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Extract the integer from GPR. Since this is truncating the
|
2003-10-03 23:11:39 +02:00
|
|
|
value, there isn't a sign extension problem. */
|
|
|
|
ULONGEST regval;
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
regcache_cooked_read_unsigned (regcache, regnum, ®val);
|
|
|
|
store_unsigned_integer (readbuf, TYPE_LENGTH (valtype),
|
|
|
|
gdbarch_byte_order (gdbarch), regval);
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
return 1;
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* Floats and doubles go in f1 .. f13. 32-bit floats are converted
|
|
|
|
to double first. */
|
|
|
|
if (TYPE_LENGTH (valtype) <= 8
|
|
|
|
&& TYPE_CODE (valtype) == TYPE_CODE_FLT)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_fp0_regnum + 1 + index;
|
|
|
|
struct type *regtype = register_type (gdbarch, regnum);
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
|
2003-11-10 23:47:31 +01:00
|
|
|
if (writebuf != NULL)
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
{
|
|
|
|
convert_typed_floating (writebuf, valtype, regval, regtype);
|
|
|
|
regcache_cooked_write (regcache, regnum, regval);
|
|
|
|
}
|
2003-11-10 23:47:31 +01:00
|
|
|
if (readbuf != NULL)
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, regnum, regval);
|
|
|
|
convert_typed_floating (regval, regtype, readbuf, valtype);
|
|
|
|
}
|
|
|
|
return 1;
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Floats and doubles go in f1 .. f13. 32-bit decimal floats are
|
|
|
|
placed in the least significant word. */
|
|
|
|
if (TYPE_LENGTH (valtype) <= 8
|
|
|
|
&& TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + 1 + index;
|
2014-02-04 18:33:04 +01:00
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
|
|
|
offset = 8 - TYPE_LENGTH (valtype);
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write_part (regcache, regnum,
|
|
|
|
offset, TYPE_LENGTH (valtype), writebuf);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read_part (regcache, regnum,
|
|
|
|
offset, TYPE_LENGTH (valtype), readbuf);
|
|
|
|
return 1;
|
|
|
|
}
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* IBM long double stored in two consecutive FPRs. */
|
|
|
|
if (TYPE_LENGTH (valtype) == 16
|
|
|
|
&& TYPE_CODE (valtype) == TYPE_CODE_FLT
|
|
|
|
&& (gdbarch_long_double_format (gdbarch)
|
|
|
|
== floatformats_ibm_long_double))
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_fp0_regnum + 1 + 2 * index;
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (writebuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_write (regcache, regnum, writebuf);
|
|
|
|
regcache_cooked_write (regcache, regnum + 1, writebuf + 8);
|
2011-02-08 14:30:10 +01:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, regnum, readbuf);
|
|
|
|
regcache_cooked_read (regcache, regnum + 1, readbuf + 8);
|
|
|
|
}
|
|
|
|
return 1;
|
2011-02-08 14:30:10 +01:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* 128-bit decimal floating-point values are stored in an even/odd
|
|
|
|
pair of FPRs, with the even FPR holding the most significant half. */
|
|
|
|
if (TYPE_LENGTH (valtype) == 16
|
|
|
|
&& TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
|
2011-02-08 14:30:10 +01:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_fp0_regnum + 2 + 2 * index;
|
2014-02-04 18:34:19 +01:00
|
|
|
int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0;
|
|
|
|
int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
|
2011-02-08 14:30:10 +01:00
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (writebuf != NULL)
|
2011-02-08 14:30:10 +01:00
|
|
|
{
|
2014-02-04 18:34:19 +01:00
|
|
|
regcache_cooked_write (regcache, regnum, writebuf + hipart);
|
|
|
|
regcache_cooked_write (regcache, regnum + 1, writebuf + lopart);
|
2011-02-08 14:30:10 +01:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
2014-02-04 18:34:19 +01:00
|
|
|
regcache_cooked_read (regcache, regnum, readbuf + hipart);
|
|
|
|
regcache_cooked_read (regcache, regnum + 1, readbuf + lopart);
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
}
|
|
|
|
return 1;
|
2011-02-08 14:30:10 +01:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* AltiVec vectors are returned in VRs starting at v2. */
|
|
|
|
if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
|
|
|
|
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_vr0_regnum + 2 + index;
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write (regcache, regnum, writebuf);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read (regcache, regnum, readbuf);
|
|
|
|
return 1;
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The 64 bit ABI return value convention.
|
|
|
|
|
|
|
|
Return non-zero if the return-value is stored in a register, return
|
|
|
|
0 if the return-value is instead stored on the stack (a.k.a.,
|
|
|
|
struct return convention).
|
|
|
|
|
|
|
|
For a return-value stored in a register: when WRITEBUF is non-NULL,
|
|
|
|
copy the buffer to the corresponding register return-value location
|
|
|
|
location; when READBUF is non-NULL, fill the buffer from the
|
|
|
|
corresponding register return-value location. */
|
|
|
|
enum return_value_convention
|
|
|
|
ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
|
|
|
struct type *valtype, struct regcache *regcache,
|
|
|
|
gdb_byte *readbuf, const gdb_byte *writebuf)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
struct type *func_type = function ? value_type (function) : NULL;
|
|
|
|
int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0;
|
|
|
|
struct type *eltype;
|
|
|
|
int nelt, i, ok;
|
|
|
|
|
|
|
|
/* This function exists to support a calling convention that
|
|
|
|
requires floating-point registers. It shouldn't be used on
|
|
|
|
processors that lack them. */
|
|
|
|
gdb_assert (ppc_floating_point_unit_p (gdbarch));
|
|
|
|
|
|
|
|
/* Complex types are returned as if two independent scalars. */
|
|
|
|
if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
eltype = check_typedef (TYPE_TARGET_TYPE (valtype));
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
|
|
|
|
readbuf, writebuf, i);
|
|
|
|
gdb_assert (ok);
|
|
|
|
|
|
|
|
if (readbuf)
|
|
|
|
readbuf += TYPE_LENGTH (eltype);
|
|
|
|
if (writebuf)
|
|
|
|
writebuf += TYPE_LENGTH (eltype);
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* OpenCL vectors shorter than 16 bytes are returned as if
|
|
|
|
a series of independent scalars; OpenCL vectors 16 bytes
|
|
|
|
or longer are returned as if a series of AltiVec vectors. */
|
|
|
|
if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
|
|
|
|
&& opencl_abi)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
if (TYPE_LENGTH (valtype) < 16)
|
|
|
|
eltype = check_typedef (TYPE_TARGET_TYPE (valtype));
|
|
|
|
else
|
|
|
|
eltype = register_type (gdbarch, tdep->ppc_vr0_regnum);
|
|
|
|
|
|
|
|
nelt = TYPE_LENGTH (valtype) / TYPE_LENGTH (eltype);
|
|
|
|
for (i = 0; i < nelt; i++)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
|
|
|
|
readbuf, writebuf, i);
|
|
|
|
gdb_assert (ok);
|
|
|
|
|
|
|
|
if (readbuf)
|
|
|
|
readbuf += TYPE_LENGTH (eltype);
|
|
|
|
if (writebuf)
|
|
|
|
writebuf += TYPE_LENGTH (eltype);
|
2003-10-03 23:11:39 +02:00
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* All pointers live in r3. */
|
|
|
|
if (TYPE_CODE (valtype) == TYPE_CODE_PTR
|
|
|
|
|| TYPE_CODE (valtype) == TYPE_CODE_REF)
|
2003-10-03 23:11:39 +02:00
|
|
|
{
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
int regnum = tdep->ppc_gp0_regnum + 3;
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write (regcache, regnum, writebuf);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read (regcache, regnum, readbuf);
|
2003-10-03 23:11:39 +02:00
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
|
|
|
|
/* Small character arrays are returned, right justified, in r3. */
|
|
|
|
if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
|
|
|
|
&& TYPE_LENGTH (valtype) <= 8
|
|
|
|
&& TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
|
|
|
|
&& TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
|
|
|
|
{
|
|
|
|
int regnum = tdep->ppc_gp0_regnum + 3;
|
|
|
|
int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
regcache_cooked_write_part (regcache, regnum,
|
|
|
|
offset, TYPE_LENGTH (valtype), writebuf);
|
|
|
|
if (readbuf != NULL)
|
|
|
|
regcache_cooked_read_part (regcache, regnum,
|
|
|
|
offset, TYPE_LENGTH (valtype), readbuf);
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
|
2014-02-04 18:42:35 +01:00
|
|
|
/* In the ELFv2 ABI, homogeneous floating-point or vector
|
|
|
|
aggregates are returned in registers. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V2
|
|
|
|
&& ppc64_elfv2_abi_homogeneous_aggregate (valtype, &eltype, &nelt))
|
|
|
|
{
|
|
|
|
for (i = 0; i < nelt; i++)
|
|
|
|
{
|
|
|
|
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
|
|
|
|
readbuf, writebuf, i);
|
|
|
|
gdb_assert (ok);
|
|
|
|
|
|
|
|
if (readbuf)
|
|
|
|
readbuf += TYPE_LENGTH (eltype);
|
|
|
|
if (writebuf)
|
|
|
|
writebuf += TYPE_LENGTH (eltype);
|
|
|
|
}
|
|
|
|
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* In the ELFv2 ABI, aggregate types of up to 16 bytes are
|
|
|
|
returned in registers r3:r4. */
|
|
|
|
if (tdep->elf_abi == POWERPC_ELF_V2
|
|
|
|
&& TYPE_LENGTH (valtype) <= 16
|
|
|
|
&& (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
|
|
|
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
|
|
|
|| (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
|
|
|
|
&& !TYPE_VECTOR (valtype))))
|
|
|
|
{
|
|
|
|
int n_regs = ((TYPE_LENGTH (valtype) + tdep->wordsize - 1)
|
|
|
|
/ tdep->wordsize);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_regs; i++)
|
|
|
|
{
|
|
|
|
gdb_byte regval[MAX_REGISTER_SIZE];
|
|
|
|
int regnum = tdep->ppc_gp0_regnum + 3 + i;
|
|
|
|
int offset = i * tdep->wordsize;
|
|
|
|
int len = TYPE_LENGTH (valtype) - offset;
|
|
|
|
|
|
|
|
if (len > tdep->wordsize)
|
|
|
|
len = tdep->wordsize;
|
|
|
|
|
|
|
|
if (writebuf != NULL)
|
|
|
|
{
|
|
|
|
memset (regval, 0, sizeof regval);
|
|
|
|
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
|
|
|
|
&& offset == 0)
|
|
|
|
memcpy (regval + tdep->wordsize - len, writebuf, len);
|
|
|
|
else
|
|
|
|
memcpy (regval, writebuf + offset, len);
|
|
|
|
regcache_cooked_write (regcache, regnum, regval);
|
|
|
|
}
|
|
|
|
if (readbuf != NULL)
|
|
|
|
{
|
|
|
|
regcache_cooked_read (regcache, regnum, regval);
|
|
|
|
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
|
|
|
|
&& offset == 0)
|
|
|
|
memcpy (readbuf, regval + tdep->wordsize - len, len);
|
|
|
|
else
|
|
|
|
memcpy (readbuf + offset, regval, len);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
}
|
|
|
|
|
Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:
According to the ABI, some types are to be decomposed into component types
for parameter and return value handling. For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type. With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.
Unfortunately, the current code is not structured to easily model these
ABI properties. For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type. This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.
To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types. This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:
FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)
This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...
gdb/ChangeLog:
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
|
|
|
/* Handle plain base types. */
|
|
|
|
if (ppc64_sysv_abi_return_value_base (gdbarch, valtype, regcache,
|
|
|
|
readbuf, writebuf, 0))
|
|
|
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
|
|
|
|
2003-10-03 23:11:39 +02:00
|
|
|
return RETURN_VALUE_STRUCT_CONVENTION;
|
|
|
|
}
|
|
|
|
|