diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-07-01 20:16:39 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-07-01 20:16:39 +0000 |
commit | dcf9f4ab7f00dba719a501c8bca3ff446edd200d (patch) | |
tree | 14915a66bc52576b54422d907b08a8b5e0258cb0 /gdb/testsuite/gdb.cp | |
parent | bc68c4e5f855998fce6b79e5d96b913b548541ed (diff) | |
download | gdb-dcf9f4ab7f00dba719a501c8bca3ff446edd200d.zip gdb-dcf9f4ab7f00dba719a501c8bca3ff446edd200d.tar.gz gdb-dcf9f4ab7f00dba719a501c8bca3ff446edd200d.tar.bz2 |
gdb/
Fall back linespec to minimal symbols.
* linespec.c (decode_line_1): New variable ex, saved_argptr. Protect
decode_compound by TRY_CATCH, fall back on minsyms if it failed.
(find_method, symbol_found): Change error to cplusplus_error.
gdb/testsuite/
Fall back linespec to minimal symbols.
* gdb.base/psymtab.exp (Don't search past end of psymtab.): Update the
error message.
* gdb.cp/cplusfuncs.exp (list foo::operator int*): Likewise.
* gdb.cp/minsym-fallback-main.cc: New file.
* gdb.cp/minsym-fallback.cc: New file.
* gdb.cp/minsym-fallback.exp: New file.
* gdb.cp/minsym-fallback.h: New file.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r-- | gdb/testsuite/gdb.cp/cplusfuncs.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/minsym-fallback-main.cc | 26 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/minsym-fallback.cc | 23 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/minsym-fallback.exp | 38 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/minsym-fallback.h | 22 |
5 files changed, 110 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp index 10e4dac..f075352 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp @@ -616,7 +616,7 @@ proc do_tests {} { # A regression test on errors involving operators gdb_test "list foo::operator $dm_type_int_star" \ - ".*the class foo does not have any method named operator $dm_type_int_star.*" + "Function \"foo::operator [string_to_regexp $dm_type_int_star]\" not defined\\." } do_tests diff --git a/gdb/testsuite/gdb.cp/minsym-fallback-main.cc b/gdb/testsuite/gdb.cp/minsym-fallback-main.cc new file mode 100644 index 0000000..a82adef --- /dev/null +++ b/gdb/testsuite/gdb.cp/minsym-fallback-main.cc @@ -0,0 +1,26 @@ +/* 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/>. */ + +#include "minsym-fallback.h" + +C c; + +int +main () +{ + c.f (); +} diff --git a/gdb/testsuite/gdb.cp/minsym-fallback.cc b/gdb/testsuite/gdb.cp/minsym-fallback.cc new file mode 100644 index 0000000..1ecd289 --- /dev/null +++ b/gdb/testsuite/gdb.cp/minsym-fallback.cc @@ -0,0 +1,23 @@ +/* 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/>. */ + +#include "minsym-fallback.h" + +void +C::f () +{ +} diff --git a/gdb/testsuite/gdb.cp/minsym-fallback.exp b/gdb/testsuite/gdb.cp/minsym-fallback.exp new file mode 100644 index 0000000..df95a2d --- /dev/null +++ b/gdb/testsuite/gdb.cp/minsym-fallback.exp @@ -0,0 +1,38 @@ +# 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/>. + +# The goal is to have class with full DWARF symbols present in one file having +# only a declaration there for the method. The method is then defined in +# a different file providing only ELF symbols. + +set testfile minsym-fallback +set srcfile ${testfile}.cc +set srcmainfile ${testfile}-main.cc +set executable $testfile +set objfile $objdir/$subdir/${testfile}.o +set objmainfile $objdir/$subdir/${testfile}-main.o +set binfile $objdir/$subdir/$executable +if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object {}] != "" + || [gdb_compile $srcdir/$subdir/$srcmainfile $objmainfile object {debug}] != "" + || [gdb_compile "$objfile $objmainfile" $binfile executable {}] != ""} { + untested ${testfile}.exp + return -1 +} + +clean_restart ${executable} + +gdb_test_no_output "set breakpoint pending off" + +gdb_test "break 'C::f()'" {Breakpoint [0-9]+ at 0x[0-9a-f]+} diff --git a/gdb/testsuite/gdb.cp/minsym-fallback.h b/gdb/testsuite/gdb.cp/minsym-fallback.h new file mode 100644 index 0000000..db32e45 --- /dev/null +++ b/gdb/testsuite/gdb.cp/minsym-fallback.h @@ -0,0 +1,22 @@ +/* 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/>. */ + +class C +{ +public: + static void f (); +}; |