diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-04-27 08:36:17 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-04-27 08:36:17 +0000 |
commit | d389af10b70d4c5be1a4a7d1317c0e6020cac979 (patch) | |
tree | 52d05451272d5f317846080fd73425ed19da5a00 /gdb/testsuite | |
parent | 8f3e5e92ceedfb5c8eae40e10c387508b8e76cee (diff) | |
download | gdb-d389af10b70d4c5be1a4a7d1317c0e6020cac979.zip gdb-d389af10b70d4c5be1a4a7d1317c0e6020cac979.tar.gz gdb-d389af10b70d4c5be1a4a7d1317c0e6020cac979.tar.bz2 |
gdb/
PR gdb/9675:
* dwarf2read.c (unsigned_int_compar, inherit_abstract_dies): New.
(read_func_scope): Call inherit_abstract_dies.
gdb/testsuite/
* gdb.cp/abstract-origin.exp, gdb.cp/abstract-origin.cc: New test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/abstract-origin.cc | 42 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/abstract-origin.exp | 31 |
3 files changed, 77 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1bb8743..fac1f19 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-04-27 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.cp/abstract-origin.exp, gdb.cp/abstract-origin.cc: New test. + 2009-04-22 Joseph Myers <joseph@codesourcery.com> * lib/gdb.exp (get_compiler_info): Use -E -o in remote-host case. diff --git a/gdb/testsuite/gdb.cp/abstract-origin.cc b/gdb/testsuite/gdb.cp/abstract-origin.cc new file mode 100644 index 0000000..9621ed6 --- /dev/null +++ b/gdb/testsuite/gdb.cp/abstract-origin.cc @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2009 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/>. + */ + +extern void f (int *); + +class A +{ +public: + A(int i); +}; + +A::A(int i) +{ + static int *problem = new int(i); + f (problem); /* break-here */ +} + +void f (int *) +{ +} + +int +main (void) +{ + A a(42); + return 0; +} diff --git a/gdb/testsuite/gdb.cp/abstract-origin.exp b/gdb/testsuite/gdb.cp/abstract-origin.exp new file mode 100644 index 0000000..9ba1194 --- /dev/null +++ b/gdb/testsuite/gdb.cp/abstract-origin.exp @@ -0,0 +1,31 @@ +# Copyright 2009 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 abstract-origin +set srcfile ${testfile}.cc +if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] { + return -1 +} + +if ![runto_main] { + untested abstract-origin + return -1 +} + +gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_continue_to_breakpoint "break-here" + +# The Bug was: No symbol "problem" in current context. +gdb_test "p problem" " = \\(int \\*\\) 0x.*" |