diff options
author | Joel Brobecker <brobecker@gnat.com> | 2010-01-29 05:19:23 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2010-01-29 05:19:23 +0000 |
commit | ba581dc13b5e3ca555a49df501d5ac74287f504d (patch) | |
tree | 8264995f3071246435079ed1ef4e6118335caeff /gdb/testsuite/gdb.ada/call_pn | |
parent | a1504221ad15cfb08f22fd5548835d33f3d041de (diff) | |
download | fsf-binutils-gdb-ba581dc13b5e3ca555a49df501d5ac74287f504d.zip fsf-binutils-gdb-ba581dc13b5e3ca555a49df501d5ac74287f504d.tar.gz fsf-binutils-gdb-ba581dc13b5e3ca555a49df501d5ac74287f504d.tar.bz2 |
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/testsuite/gdb.ada/call_pn')
-rw-r--r-- | gdb/testsuite/gdb.ada/call_pn/foo.adb | 23 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/call_pn/pck.adb | 25 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/call_pn/pck.ads | 23 |
3 files changed, 71 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/call_pn/foo.adb b/gdb/testsuite/gdb.ada/call_pn/foo.adb new file mode 100644 index 0000000..a71969b --- /dev/null +++ b/gdb/testsuite/gdb.ada/call_pn/foo.adb @@ -0,0 +1,23 @@ +-- Copyright 2010 Free Software Foundation, Inc. +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (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 +-- along with this program. If not, see <http://www.gnu.org/licenses/>. + +with Pck; use Pck; + +procedure Foo is + New_Node : Node_Id; +begin + New_Node := Pn (1234); -- STOP +end Foo; + diff --git a/gdb/testsuite/gdb.ada/call_pn/pck.adb b/gdb/testsuite/gdb.ada/call_pn/pck.adb new file mode 100644 index 0000000..cc2dfb6 --- /dev/null +++ b/gdb/testsuite/gdb.ada/call_pn/pck.adb @@ -0,0 +1,25 @@ +-- Copyright 2010 Free Software Foundation, Inc. +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (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 +-- along with this program. If not, see <http://www.gnu.org/licenses/>. + +package body Pck is + Last_Node_Id : Node_Id := Node_Id'First; + + function Pn (N : Node_Id) return Node_Id is + begin + Last_Node_Id := N; + return N; + end Pn; +end Pck; + diff --git a/gdb/testsuite/gdb.ada/call_pn/pck.ads b/gdb/testsuite/gdb.ada/call_pn/pck.ads new file mode 100644 index 0000000..11e21c3 --- /dev/null +++ b/gdb/testsuite/gdb.ada/call_pn/pck.ads @@ -0,0 +1,23 @@ +-- Copyright 2010 Free Software Foundation, Inc. +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (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 +-- along with this program. If not, see <http://www.gnu.org/licenses/>. + +package Pck is + Node_Low_Bound : constant := 0; + Node_High_Bound : constant := 099_999_999; + type Node_Id is range Node_Low_Bound .. Node_High_Bound; + + function Pn (N : Node_Id) return Node_Id; +end Pck; + |