diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/Makefile.in | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-entry-value.cc | 42 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-entry-value.exp | 47 |
4 files changed, 98 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d21d922..52e544e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2011-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> + Implement basic support for DW_TAG_GNU_call_site. + * gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value. + * gdb.arch/amd64-entry-value.cc: New file. + * gdb.arch/amd64-entry-value.exp: New file. + +2011-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> + Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. * gdb.dwarf2/implptr-64bit.S: New file. * gdb.dwarf2/implptr-64bit.exp: New file. diff --git a/gdb/testsuite/gdb.arch/Makefile.in b/gdb/testsuite/gdb.arch/Makefile.in index a86edaf..619f78d 100644 --- a/gdb/testsuite/gdb.arch/Makefile.in +++ b/gdb/testsuite/gdb.arch/Makefile.in @@ -1,8 +1,8 @@ VPATH = @srcdir@ srcdir = @srcdir@ -EXECUTABLES = altivec-abi altivec-regs amd64-byte amd64-disp-step \ - amd64-dword amd64-i386-address amd64-word i386-bp_permanent \ +EXECUTABLES = altivec-abi altivec-regs amd64-byte amd64-disp-step amd64-dword \ + amd64-entry-value amd64-i386-address amd64-word i386-bp_permanent \ i386-permbkpt i386-avx i386-signal i386-sse all info install-info dvi install uninstall installcheck check: diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.cc b/gdb/testsuite/gdb.arch/amd64-entry-value.cc new file mode 100644 index 0000000..b492231 --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.cc @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2011 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/>. */ + +static volatile int v; + +static void __attribute__((noinline, noclone)) +e (int i, double j) +{ + v = 0; +} + +static void __attribute__((noinline, noclone)) +d (int i, double j) +{ + i++; + j++; + e (i, j); + e (v, v); +asm ("breakhere:"); + e (v, v); +} + +int +main () +{ + d (30, 30.5); + return 0; +} diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp new file mode 100644 index 0000000..e73254b --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp @@ -0,0 +1,47 @@ +# Copyright (C) 2011 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/>. + +set testfile amd64-entry-value +set srcfile ${testfile}.s +set opts {} + +if [info exists COMPILE] { + # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value.exp COMPILE=1" + set srcfile ${testfile}.cc + lappend opts debug optimize=-O2 +} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } { + verbose "Skipping amd64-entry-value." + return +} + +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } { + return -1 +} + +if ![runto_main] { + return -1 +} + +gdb_breakpoint "breakhere" + + +# Test @entry values for register passed parameters. + +gdb_continue_to_breakpoint "entry: breakhere" + +gdb_test "bt" "^bt\r\n#0 +d *\\(i=31, j=31\\.5\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in main .*" \ + "entry: bt" +gdb_test "p i" " = 31" "entry: p i" +gdb_test "p j" { = 31\.5} "entry: p j" |