diff options
author | Joel Brobecker <brobecker@gnat.com> | 2010-01-29 05:19:22 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2010-01-29 05:19:22 +0000 |
commit | 285e284cdcd5bd63bf316ddefaf642833d5a0f6a (patch) | |
tree | be0b53eda48032792adb7dab14c8b24faa8801a6 /gdb/i386-tdep.h | |
parent | a54573f7582d0c73bc98ac06969bbcf3310ac16a (diff) | |
download | gdb-285e284cdcd5bd63bf316ddefaf642833d5a0f6a.tar.gz |
amd64: Integer parameters in function calls on Windows.
gdb/ChangeLog:
* i386-tdep.h (enum amd64_reg_class): New, moved here from
amd64-tdep.c.
(struct gdbarch_tdep): Add fields call_dummy_num_integer_regs,
call_dummy_integer_regs, and classify.
* amd64-tdep.h (amd64_classify): Add declaration.
* amd64-tdep.c (amd64_dummy_call_integer_regs): New static constant.
(amd64_reg_class): Delete, moved to i386-tdep.h.
(amd64_classify): Make non-static. Move declaration to amd64-tdep.h.
Replace call to amd64_classify by call to tdep->classify.
(amd64_push_arguments): Get the list of registers to use for
passing integer parameters from the gdbarch tdep structure,
rather than using a hardcoded one. Replace calls to amd64_classify
by calls to tdep->classify.
(amd64_push_dummy_call): Get the register number used for
the "hidden" argument from tdep->call_dummy_integer_regs.
(amd64_init_abi): Initialize tdep->call_dummy_num_integer_regs
and tdep->call_dummy_integer_regs. Set tdep->classify.
* amd64-windows-tdep.c: Add include of gdbtypes.h.
(amd64_windows_dummy_call_integer_regs): New static global.
(amd64_windows_classify): New function.
(amd64_windows_init_abi): Initialize tdep->call_dummy_num_integer_regs
tdep->call_dummy_integer_regs and tdep->classify.
gdb/testsuite/ChangeLog:
* gdb.ada/call_pn: New testcase.
Diffstat (limited to 'gdb/i386-tdep.h')
-rw-r--r-- | gdb/i386-tdep.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 6013bdf1e09..d5b24faf729 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -53,6 +53,20 @@ enum struct_return reg_struct_return /* Return "short" structures in registers. */ }; +/* Register classes as defined in the AMD x86-64 psABI. */ + +enum amd64_reg_class +{ + AMD64_INTEGER, + AMD64_SSE, + AMD64_SSEUP, + AMD64_X87, + AMD64_X87UP, + AMD64_COMPLEX_X87, + AMD64_NO_CLASS, + AMD64_MEMORY +}; + /* i386 architecture specific information. */ struct gdbarch_tdep { @@ -62,6 +76,16 @@ struct gdbarch_tdep int gregset_num_regs; size_t sizeof_gregset; + /* The general-purpose registers used to pass integers when making + function calls. This only applies to amd64, as all parameters + are passed through the stack on x86. */ + int call_dummy_num_integer_regs; + int *call_dummy_integer_regs; + + /* Classify TYPE according to calling conventions, and store + the result in CLASS. Used on amd64 only. */ + void (*classify) (struct type *type, enum amd64_reg_class class[2]); + /* Floating-point registers. */ struct regset *fpregset; size_t sizeof_fpregset; |