* [RFA 1/3] dwarf2_physname - cpexprs.exp
@ 2009-11-20 21:08 Keith Seitz
2009-11-21 5:21 ` Pedro Alves
2009-11-21 17:12 ` Daniel Jacobowitz
0 siblings, 2 replies; 4+ messages in thread
From: Keith Seitz @ 2009-11-20 21:08 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]
Hi,
A while ago, we discussed this patch, which essentially removes gdb's
dependence on DW_AT_MIPS_linkage_name. I've been using this patchset on
my Archer branch (archer-keiths-expr-cumulative) for quite some time.
The patches attempt to fix a bunch of C++ expression parsing problems in
three areas:
1) Symbol lookups
2) linespecs
3) parsing
I've already separately addressed #3, and these patches now attempt to
address the remaining two areas.
I'm starting this whole process of by submitting my "realcpp" tests from
the archer branch (which I've renamed). These tests are far more
involved than gdb's simplistic testsuite/gdb.cp tests. [Of course, there
is still plenty more to test/add!]
Running these tests on CVS HEAD currently gives (go ahead, try it: I
dare you :-):
=== gdb Summary ===
# of expected passes 77
# of unexpected failures 54
# of unresolved testcases 123
Not good -- gdb crashes along the way.
However, with this entire patchset applied, all 378 test in cpexprs.exp
will pass.
Comments/questions/concerns?
Keith
testsuite/ChangeLog
2009-11-20 Keith Seitz <keiths@redhat.com>
* gdb.cp/cpexprs.exp: New file.
* gdb.cp/cpexprs.cc: New file.
[-- Attachment #2: cpexprs.patch --]
[-- Type: text/plain, Size: 31049 bytes --]
Index: testsuite/gdb.cp/cpexprs.exp
===================================================================
RCS file: testsuite/gdb.cp/cpexprs.exp
diff -N testsuite/gdb.cp/cpexprs.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.cp/cpexprs.exp 20 Nov 2009 20:36:59 -0000
@@ -0,0 +1,704 @@
+# cpexprs.exp - C++ expressions tests
+#
+# Copyright 2008, 2009 Free Software Foundation, Inc.
+#
+# Contributed by Red Hat, originally written by Keith Seitz.
+#
+# 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/>.
+
+# This file is part of the gdb testsuite.
+
+# A helper proc which sets a breakpoint at FUNC and attempts to
+# run to the breakpoint.
+proc test_breakpoint {func} {
+ global DEC
+
+ # Restart every time
+ if {![runto_main]} {
+ perror "could not run to main when attempting to break at $func"
+ continue
+ } else {
+ gdb_breakpoint "$func"
+ set i [expr {[string last : $func] + 1}]
+ set efunc [escape [string range $func $i end]]
+ gdb_test "continue" \
+ "Continuing.\r\n\r\nBreakpoint $DEC+,.*$efunc.*" \
+ "continue to $func"
+ }
+}
+
+# Escape expect-reserved characters in the string
+proc escape {string} {
+ regsub -all {\*} $string {\*} string
+ regsub -all {\(} $string {\(} string
+ regsub -all {\)} $string {\)} string
+ regsub -all {\]} $string {\]} string
+ regsub -all {\[} $string {\[} string
+ regsub -all {\+} $string {\+} string
+ regsub -all {\^} $string {\^} string
+ regsub -all {\!} $string {\!} string
+ return $string
+}
+
+# Add a function to the list of tested functions
+# FUNC is the name of the function (which will be passed to gdb commands)
+# TYPE is the type of the function, as expected from the "print" command
+# PRINT is the name of the function, as expected result of the print command
+# *OR* "-", indicating that FUNC should be used (needed for virtual/inherited
+# funcs)
+# LST is either the expected result of the list command (the comment from
+# the source code) *OR* "-", in which case FUNC will be used
+#
+# Usage:
+# add NAME TYPE PRINT LST
+# add NAME TYPE PRINT -
+proc add {func type print lst} {
+ global all_functions CONVAR ADDR
+
+ set all_functions($func,type) $type
+ if {$print == "-"} {
+ set print $func
+ }
+
+ # An exception: since gdb canonicalizes C++ output,
+ # "(void)" must be mutated to "()".
+ set print [regsub {\(void\)} $print {()}]
+
+ set all_functions($func,print) \
+ "$CONVAR = {[escape $type]} $ADDR <[escape $print].*>"
+ if {$lst == "-"} {
+ set lst "$func"
+ }
+ set all_functions($func,list) ".*// [escape $lst]"
+}
+
+proc get {func cmd} {
+ global all_functions
+ return $all_functions($func,$cmd)
+}
+
+# Returns a list of function names for a given command
+proc get_functions {cmd} {
+ global all_functions
+ set result {}
+ foreach i [array names all_functions *,$cmd] {
+ if {$all_functions($i) != ""} {
+ set idx [string last , $i]
+ if {$idx != -1} {
+ lappend result [string range $i 0 [expr {$idx - 1}]]
+ }
+ }
+ }
+
+ return [lsort $result]
+}
+
+# Some convenience variables for this test
+set DEC {[0-9]}; # a decimal number
+set HEX {[0-9a-fA-F]}; # a hexidecimal number
+set CONVAR "\\\$$DEC+"; # convenience variable regexp
+set ADDR "0x$HEX+"; # address
+
+# An array of functions/methods that we are testing...
+# Each element consists is indexed by NAME,COMMAND, where
+# NAME is the function name and COMMAND is the gdb command that
+# we are testing. The value of the array for any index pair is
+# the expected result of running COMMAND with the NAME as argument.
+
+# The array holding all functions/methods to test. Valid subindexes
+# are (none need character escaping -- "add" will take care of that):
+
+# add name type print_name list
+# NAME,type: value is type of function
+# NAME,print: value is print name of function (careful w/inherited/virtual!)
+# NAME,list: value is comment in source code on first line of function
+# (without the leading "//")
+array set all_functions {}
+
+# "Normal" functions/methods
+add {main} \
+ {int (int, char **)} \
+ - \
+ -
+add {derived::a_function} \
+ {void (const derived * const)} \
+ - \
+ -
+add {base1::a_function} \
+ {void (const base1 * const)} \
+ - \
+ -
+add {base2::a_function} \
+ {void (const base2 * const)} \
+ - \
+ -
+
+# Constructors
+add {derived::derived} \
+ {void (derived * const)} \
+ - \
+ -
+add {base1::base1(void)} \
+ {void (base1 * const, const void ** const)} \
+ - \
+ -
+add {base1::base1(int)} \
+ {void (base1 * const, int)} \
+ - \
+ -
+add {base2::base2} \
+ {void (base2 * const, const void ** const)} \
+ - \
+ -
+add {base::base(void)} \
+ {void (base * const)} \
+ - \
+ -
+add {base::base(int)} \
+ {void (base * const, int)} \
+ - \
+ - \
+
+# Destructors
+add {base::~base} \
+ {void (base * const)} \
+ - \
+ -
+
+# Overloaded methods (all are const -- we try to use the void
+# method with and without specifying "const")
+add {base::overload(void)} \
+ {int (const base * const)} \
+ - \
+ {base::overload(void) const}
+add {base::overload(void) const} \
+ {int (const base * const)} \
+ - \
+ {base::overload(void) const}
+add {base::overload(int) const} \
+ {int (const base * const, int)} \
+ - \
+ -
+add {base::overload(short) const} \
+ {int (const base * const, short)} \
+ - \
+ -
+add {base::overload(long) const} \
+ {int (const base * const, long)} \
+ - \
+ -
+add {base::overload(char*) const} \
+ {int (const base * const, char *)} \
+ - \
+ -
+add {base::overload(base&) const} \
+ {int (const base * const, base &)} \
+ - \
+ -
+
+# Operators
+add {base::operator+} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator++} \
+ {base (base * const)} \
+ - \
+ -
+add {base::operator+=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator-} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator--} \
+ {base (base * const)} \
+ - \
+ -
+add {base::operator-=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator*} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator*=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator/} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator/=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator%} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator%=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator<} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator<=} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator>} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator>=} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator!=} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator==} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator!} \
+ {bool (const base * const)} \
+ - \
+ -
+add {base::operator&&} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator||} \
+ {bool (const base * const, const base &)} \
+ - \
+ -
+add {base::operator<<} \
+ {int (const base * const, int)} \
+ - \
+ -
+add {base::operator<<=} \
+ {base (base * const, int)} \
+ - \
+ -
+add {base::operator>>} \
+ {int (const base * const, int)} \
+ - \
+ -
+add {base::operator>>=} \
+ {base (base * const, int)} \
+ - \
+ -
+add {base::operator~} \
+ {int (const base * const)} \
+ - \
+ -
+add {base::operator&} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator&=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator|} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator|=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator^} \
+ {int (const base * const, const base &)} \
+ - \
+ -
+add {base::operator^=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator=} \
+ {base (base * const, const base &)} \
+ - \
+ -
+add {base::operator()} \
+ {void (const base * const)} \
+ - \
+ -
+add {base::operator[]} \
+ {int (const base * const, int)} \
+ - \
+ -
+add {base::operator new} \
+ {void *(size_t)} \
+ - \
+ -
+add {base::operator delete} \
+ {void (void *)} \
+ - \
+ -
+add {base::operator new[]} \
+ {void *(size_t)} \
+ - \
+ -
+add {base::operator delete[]} \
+ {void (void *)} \
+ - \
+ -
+add {base::operator char*} \
+ {char *(const base * const)} \
+ - \
+ -
+add {base::operator fluff*} \
+ {fluff *(const base * const)} \
+ - \
+ -
+add {base::operator fluff**} \
+ {fluff **(const base * const)} \
+ - \
+ -
+add {base::operator int} \
+ {int (const base * const)} \
+ - \
+ -
+
+# Templates
+add {tclass<char>::do_something} \
+ {void (tclass<char> * const)} \
+ - \
+ -
+add {tclass<int>::do_something} \
+ {void (tclass<int> * const)} \
+ - \
+ -
+add {tclass<long>::do_something} \
+ {void (tclass<long> * const)} \
+ - \
+ -
+add {tclass<short>::do_something} \
+ {void (tclass<short> * const)} \
+ - \
+ -
+add {tclass<base>::do_something} \
+ {void (tclass<base> * const)} \
+ - \
+ -
+add {flubber<int, int, int, int, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, int, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, int, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, int, char>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, short, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, short, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, short, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, short, char>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, long, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, long, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, long, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, long, char>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, char, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, char, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, char, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, int, char, char>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, short, int, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, short, int, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, short, int, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, short, int, char>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<int, int, short, short, int>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<short, int, short, int, short>} \
+ {void (void)} \
+ - \
+ flubber
+add {flubber<long, short, long, short, long>} \
+ {void (void)} \
+ - \
+ flubber
+add {tclass<base>::do_something} \
+ {void (tclass<base> * const)} \
+ - \
+ {tclass<T>::do_something}
+add {policy1::policy} \
+ {void (policy<int, operation_1<void*> > * const, int)} \
+ {policy<int, operation_1<void*> >::policy} \
+ {policy<T, Policy>::policy}
+add {policy2::policy} \
+ {void (policy<int, operation_2<void*> > * const, int)} \
+ {policy<int, operation_2<void*> >::policy} \
+ {policy<T, Policy>::policy}
+add {policy3::policy} \
+ {void (policy<int, operation_3<void*> > * const, int)} \
+ {policy<int, operation_3<void*> >::policy} \
+ {policy<T, Policy>::policy}
+add {policy4::policy} \
+ {void (policy<int, operation_4<void*> > * const, int)} \
+ {policy<int, operation_4<void*> >::policy} \
+ {policy<T, Policy>::policy}
+add {policy1::function} \
+ {void (void)} \
+ {operation_1<void*>::function} \
+ {operation_1<T>::function}
+add {policy2::function} \
+ {void (void)} \
+ {operation_2<void*>::function} \
+ {operation_2<T>::function}
+add {policy3::function} \
+ {void (void)} \
+ {operation_3<void*>::function} \
+ {operation_3<T>::function}
+add {policy4::function} \
+ {void (void)} \
+ {operation_4<void*>::function} \
+ {operation_4<T>::function}
+add {policyd<int, operation_1<int> >::policyd} \
+ {void (policyd<int, operation_1<int> > * const, int)} \
+ - \
+ {policyd<T, Policy>::policyd}
+add {policyd1::policyd} \
+ {void (policyd<int, operation_1<int> > * const, int)} \
+ {policyd<int, operation_1<int> >::policyd} \
+ {policyd<T, Policy>::policyd}
+add {policyd<int, operation_1<int> >::~policyd} \
+ {void (policyd<int, operation_1<int> > * const)} \
+ - \
+ {policyd<T, Policy>::~policyd}
+add {policyd1::~policyd} \
+ {void (policyd<int, operation_1<int> > * const)} \
+ {policyd<int, operation_1<int> >::~policyd} \
+ {policyd<T, Policy>::~policyd}
+add {policyd<long, operation_1<long> >::policyd} \
+ {void (policyd<long, operation_1<long> > * const, long)} \
+ - \
+ {policyd<T, Policy>::policyd}
+add {policyd2::policyd} \
+ {void (policyd<long, operation_1<long> > * const, long)} \
+ {policyd<long, operation_1<long> >::policyd} \
+ {policyd<T, Policy>::policyd}
+add {policyd<long, operation_1<long> >::~policyd} \
+ {void (policyd<long, operation_1<long> > * const)} \
+ - \
+ {policyd<T, Policy>::~policyd}
+add {policyd2::~policyd} \
+ {void (policyd<long, operation_1<long> > * const)} \
+ {policyd<long, operation_1<long> >::~policyd} \
+ {policyd<T, Policy>::~policyd}
+add {policyd<char, operation_1<char> >::policyd} \
+ {void (policyd<char, operation_1<char> > * const, char)} \
+ - \
+ {policyd<T, Policy>::policyd}
+add {policyd3::policyd} \
+ {void (policyd<char, operation_1<char> > * const, char)} \
+ {policyd<char, operation_1<char> >::policyd} \
+ {policyd<T, Policy>::policyd}
+add {policyd<char, operation_1<char> >::~policyd} \
+ {void (policyd<char, operation_1<char> > * const)} \
+ - \
+ {policyd<T, Policy>::~policyd}
+add {policyd3::~policyd} \
+ {void (policyd<char, operation_1<char> > * const)} \
+ {policyd<char, operation_1<char> >::~policyd} \
+ {policyd<T, Policy>::~policyd}
+add {policyd<base, operation_1<base> >::policyd} \
+ {void (policyd<base, operation_1<base> > * const, base)} \
+ - \
+ {policyd<T, Policy>::policyd}
+add {policyd4::policyd} \
+ {void (policyd<base, operation_1<base> > * const, base)} \
+ {policyd<base, operation_1<base> >::policyd} \
+ {policyd<T, Policy>::policyd}
+add {policyd<base, operation_1<base> >::~policyd} \
+ {void (policyd<base, operation_1<base> > * const)} \
+ - \
+ {policyd<T, Policy>::~policyd}
+add {policyd4::~policyd} \
+ {void (policyd<base, operation_1<base> > * const)} \
+ {policyd<base, operation_1<base> >::~policyd} \
+ {policyd<T, Policy>::~policyd}
+add {policyd<tclass<int>, operation_1<tclass<int> > >::policyd} \
+ {void (policyd<tclass<int>, operation_1<tclass<int> > > * const, tclass<int>)} \
+ - \
+ {policyd<T, Policy>::policyd}
+add {policyd5::policyd} \
+ {void (policyd<tclass<int>, operation_1<tclass<int> > > * const, tclass<int>)} \
+ {policyd<tclass<int>, operation_1<tclass<int> > >::policyd} \
+ {policyd<T, Policy>::policyd}
+add {policyd<tclass<int>, operation_1<tclass<int> > >::~policyd} \
+ {void (policyd<tclass<int>, operation_1<tclass<int> > > * const)} \
+ - \
+ {policyd<T, Policy>::~policyd}
+add {policyd5::~policyd} \
+ {void (policyd<tclass<int>, operation_1<tclass<int> > > * const)} \
+ {policyd<tclass<int>, operation_1<tclass<int> > >::~policyd} \
+ {policyd<T, Policy>::~policyd}
+add {policyd<int, operation_1<int> >::function} \
+ {void (void)} \
+ {operation_1<int>::function}\
+ {operation_1<T>::function}
+add {policyd1::function} \
+ {void (void)} \
+ {operation_1<int>::function} \
+ {operation_1<T>::function}
+add {policyd2::function} \
+ {void (void)} \
+ {operation_1<long>::function} \
+ {operation_1<T>::function}
+add {policyd<char, operation_1<char> >::function} \
+ {void (void)} \
+ {operation_1<char>::function} \
+ {operation_1<T>::function}
+add {policyd3::function} \
+ {void (void)} \
+ {operation_1<char>::function} \
+ {operation_1<T>::function}
+add {policyd<base, operation_1<base> >::function} \
+ {void (void)} \
+ {operation_1<base>::function} \
+ {operation_1<T>::function}
+add {policyd4::function} \
+ {void (void)} \
+ {operation_1<base>::function} \
+ {operation_1<T>::function}
+add {policyd<tclass<int>, operation_1<tclass<int> > >::function} \
+ {void (void)} \
+ {operation_1<tclass<int> >::function} \
+ {operation_1<T>::function}
+add {policyd5::function} \
+ {void (void)} \
+ {operation_1<tclass<int> >::function} \
+ {operation_1<T>::function}
+
+# Start the test
+if {$tracelevel} {
+ strace $tracelevel
+}
+
+if {[skip_cplus_tests]} { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "cpexprs"
+set srcfile "${testfile}.cc"
+set binfile [file join $objdir $subdir $testfile]
+
+if {[gdb_compile [file join $srcdir $subdir $srcfile] $binfile \
+ executable {debug c++}] != "" } {
+ untested "$testfile.exp"
+ return -1
+}
+
+if {[get_compiler_info $binfile "c++"]} {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir [file join $srcdir $subdir]
+gdb_load $binfile
+
+# Set the listsize to one. This will help with testing "list".
+gdb_test "set listsize 1"
+
+# "print METHOD"
+foreach name [get_functions print] {
+ gdb_test "print $name" [get $name print] "print $name"
+}
+
+# "list METHOD"
+foreach name [get_functions list] {
+ gdb_test "list $name" [get $name list] "list $name"
+}
+
+# Running to breakpoint -- use any function we can "list"
+foreach name [get_functions list] {
+ # Skip "main", since test_breakpoint uses it
+ if {[string compare $name "main"] != 0} {
+ test_breakpoint $name
+ }
+}
+
+gdb_exit
+return 0
Index: testsuite/gdb.cp/cpexprs.cc
===================================================================
RCS file: testsuite/gdb.cp/cpexprs.cc
diff -N testsuite/gdb.cp/cpexprs.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.cp/cpexprs.cc 20 Nov 2009 20:36:59 -0000
@@ -0,0 +1,431 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008, 2009 Free Software Foundation, Inc.
+
+ Contributed by Red Hat, originally written by Keith Seitz.
+
+ 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+#include <stdlib.h>
+#include <iostream>
+
+// Forward decls
+class base;
+class derived;
+
+// A simple template with specializations
+template <typename T>
+class tclass
+{
+public:
+ void do_something () { } // tclass<T>::do_something
+};
+
+template <>
+void tclass<char>::do_something () { } // tclass<char>::do_something
+
+template <>
+void tclass<int>::do_something () { } // tclass<int>::do_something
+
+template<>
+void tclass<long>::do_something () { } // tclass<long>::do_something
+
+template<>
+void tclass<short>::do_something () { } // tclass<short>::do_something
+
+// A simple template with multiple template parameters
+template <class A, class B, class C, class D, class E>
+void flubber (void) // flubber
+{
+ A a;
+ B b;
+ C c;
+ D d;
+ E e;
+
+ ++a;
+ ++b;
+ ++c;
+ ++d;
+ ++e;
+}
+
+// Some contrived policies
+template <class T>
+struct operation_1
+{
+ static void function (void) { } // operation_1<T>::function
+};
+
+template <class T>
+struct operation_2
+{
+ static void function (void) { } // operation_2<T>::function
+};
+
+template <class T>
+struct operation_3
+{
+ static void function (void) { } // operation_3<T>::function
+};
+
+template <class T>
+struct operation_4
+{
+ static void function (void) { } // operation_4<T>::function
+};
+
+// A policy-based class w/ and w/o default policy
+template <class T, class Policy>
+class policy : public Policy
+{
+public:
+ policy (T obj) : obj_ (obj) { } // policy<T, Policy>::policy
+
+private:
+ T obj_;
+};
+
+template <class T, class Policy = operation_1<T> >
+class policyd : public Policy
+{
+public:
+ policyd (T obj) : obj_ (obj) { } // policyd<T, Policy>::policyd
+ ~policyd (void) { } // policyd<T, Policy>::~policyd
+
+private:
+ T obj_;
+};
+
+typedef policy<int, operation_1<void*> > policy1;
+typedef policy<int, operation_2<void*> > policy2;
+typedef policy<int, operation_3<void*> > policy3;
+typedef policy<int, operation_4<void*> > policy4;
+
+typedef policyd<int> policyd1;
+typedef policyd<long> policyd2;
+typedef policyd<char> policyd3;
+typedef policyd<base> policyd4;
+typedef policyd<tclass<int> > policyd5;
+
+class fluff { };
+static fluff *g_fluff = new fluff ();
+
+class base
+{
+protected:
+ int foo_;
+
+public:
+ base (void) : foo_ (42) { } // base::base(void)
+ base (int foo) : foo_ (foo) { } // base::base(int)
+ ~base (void) { } // base::~base
+
+ // Some overloaded methods
+ int overload (void) const { return 0; } // base::overload(void) const
+ int overload (int i) const { return 1; } // base::overload(int) const
+ int overload (short s) const { return 2; } // base::overload(short) const
+ int overload (long l) const { return 3; } // base::overload(long) const
+ int overload (char* a) const { return 4; } // base::overload(char*) const
+ int overload (base& b) const { return 5; } // base::overload(base&) const
+
+ // Operators
+ int operator+ (base const& o) const // base::operator+
+ { return foo_ + o.foo_; }
+
+ base operator++ (void) // base::operator++
+ { ++foo_; return *this; }
+
+ base operator+=(base const& o) // base::operator+=
+ { foo_ += o.foo_; return *this; }
+
+ int operator- (base const& o) const // base::operator-
+ { return foo_ - o.foo_; }
+
+ base operator-- (void) // base::operator--
+ { --foo_; return *this; }
+
+ base operator-= (base const& o) // base::operator-=
+ { foo_ -= o.foo_; return *this; }
+
+ int operator* (base const& o) const // base::operator*
+ { return foo_ * o.foo_; }
+
+ base operator*= (base const& o) // base::operator*=
+ { foo_ *= o.foo_; return *this; }
+
+ int operator/ (base const& o) const // base::operator/
+ { return foo_ / o.foo_; }
+
+ base operator/= (base const& o) // base::operator/=
+ { foo_ /= o.foo_; return *this; }
+
+ int operator% (base const& o) const // base::operator%
+ { return foo_ % o.foo_; }
+
+ base operator%= (base const& o) // base::operator%=
+ { foo_ %= o.foo_; return *this; }
+
+ bool operator< (base const& o) const // base::operator<
+ { return foo_ < o.foo_; }
+
+ bool operator<= (base const& o) const // base::operator<=
+ { return foo_ <= o.foo_; }
+
+ bool operator> (base const& o) const // base::operator>
+ { return foo_ > o.foo_; }
+
+ bool operator>= (base const& o) const // base::operator>=
+ { return foo_ >= o.foo_; }
+
+ bool operator!= (base const& o) const // base::operator!=
+ { return foo_ != o.foo_; }
+
+ bool operator== (base const& o) const // base::operator==
+ { return foo_ == o.foo_; }
+
+ bool operator! (void) const // base::operator!
+ { return !foo_; }
+
+ bool operator&& (base const& o) const // base::operator&&
+ { return foo_ && o.foo_; }
+
+ bool operator|| (base const& o) const // base::operator||
+ { return foo_ || o.foo_; }
+
+ int operator<< (int value) const // base::operator<<
+ { return foo_ << value; }
+
+ base operator<<= (int value) // base::operator<<=
+ { foo_ <<= value; return *this; }
+
+ int operator>> (int value) const // base::operator>>
+ { return foo_ >> value; }
+
+ base operator>>= (int value) // base::operator>>=
+ { foo_ >>= value; return *this; }
+
+ int operator~ (void) const // base::operator~
+ { return ~foo_; }
+
+ int operator& (base const& o) const // base::operator&
+ { return foo_ & o.foo_; }
+
+ base operator&= (base const& o) // base::operator&=
+ { foo_ &= o.foo_; return *this; }
+
+ int operator| (base const& o) const // base::operator|
+ { return foo_ | o.foo_; }
+
+ base operator|= (base const& o) // base::operator|=
+ { foo_ |= o.foo_; return *this; }
+
+ int operator^ (base const& o) const // base::operator^
+ { return foo_ ^ o.foo_; }
+
+ base operator^= (base const& o) // base::operator^=
+ { foo_ ^= o.foo_; return *this; }
+
+ base operator= (base const& o) // base::operator=
+ { foo_ = o.foo_; return *this; }
+
+ void operator() (void) const // base::operator()
+ { return; }
+
+ int operator[] (int idx) const // base::operator[]
+ { return idx; }
+
+ void* operator new (size_t size) throw () // base::operator new
+ { return malloc (size); }
+
+ void operator delete (void* ptr) // base::operator delete
+ { free (ptr); }
+
+ void* operator new[] (size_t size) throw () // base::operator new[]
+ { return malloc (size); }
+
+ void operator delete[] (void* ptr) // base::operator delete[]
+ { free (ptr); }
+
+ base const* operator-> (void) const // base::opeartor->
+ { return this; }
+
+ int operator->* (base const& b) const // base::operator->*
+ { return foo_ * b.foo_; }
+
+ operator char* () const { return const_cast<char*> ("hello"); } // base::operator char*
+ operator int () const { return 21; } // base::operator int
+ operator fluff* () const { return new fluff (); } // base::operator fluff*
+ operator fluff** () const { return &g_fluff; } // base::operator fluff**
+};
+
+class base1 : public virtual base
+{
+public:
+ base1 (void) : foo_ (21) { } // base1::base1(void)
+ base1 (int a) : foo_(a) { } // base1::base1(int)
+ void a_function (void) const { } // base1::a_function
+
+protected:
+ int foo_;
+};
+
+class base2 : public virtual base
+{
+public:
+ base2 () : foo_ (3) { } // base2::base2
+
+protected:
+ void a_function (void) const { } // base2::a_function
+ int foo_;
+};
+
+class derived : public base1, public base2
+{
+ public:
+ derived(void) : foo_ (4) { } // derived::derived
+ void a_function (void) const // derived::a_function
+ {
+ this->base1::a_function ();
+ this->base2::a_function ();
+ }
+
+ protected:
+ int foo_;
+};
+
+int
+main (int argc, char* argv[]) // main
+{ // main
+ derived d;
+ void (derived::*pfunc) (void) const = &derived::a_function;
+ (d.*pfunc) ();
+
+ base a (1), b (3), c (8);
+ (void) a.overload ();
+ (void) a.overload (static_cast<int> (0));
+ (void) a.overload (static_cast<short> (0));
+ (void) a.overload (static_cast<long> (0));
+ (void) a.overload (static_cast<char*> (0));
+ (void) a.overload (a);
+
+ int r;
+ r = b + c;
+ ++a;
+ a += b;
+ r = b - c;
+ --a;
+ a -= b;
+ r = b * c;
+ a *= b;
+ r = b / c;
+ a /= b;
+ r = b % c;
+ a %= b;
+ bool x = (b < c);
+ x = (b <= c);
+ x = (b > c);
+ x = (b >= c);
+ x = (b != c);
+ x = (b == c);
+ x = (!b);
+ x = (b && c);
+ x = (b || c);
+ r = b << 2;
+ a <<= 1;
+ r = b >> 2;
+ a >>= 1;
+ r = ~b;
+ r = b & c;
+ a &= c;
+ r = b | c;
+ a |= c;
+ r = b ^ c;
+ a ^= c;
+ a = c;
+ a ();
+ int i = a[3];
+ derived* f = new derived ();
+ derived* g = new derived[3];
+ delete f;
+ delete[] g;
+ a->overload ();
+ r = a->*b;
+
+ tclass<char> char_tclass;
+ tclass<int> int_tclass;
+ tclass<short> short_tclass;
+ tclass<long> long_tclass;
+ tclass<base> base_tclass;
+ char_tclass.do_something ();
+ int_tclass.do_something ();
+ short_tclass.do_something ();
+ long_tclass.do_something ();
+ base_tclass.do_something ();
+
+ flubber<int, int, int, int, int> ();
+ flubber<int, int, int, int, short> ();
+ flubber<int, int, int, int, long> ();
+ flubber<int, int, int, int, char> ();
+ flubber<int, int, int, short, int> ();
+ flubber<int, int, int, short, short> ();
+ flubber<int, int, int, short, long> ();
+ flubber<int, int, int, short, char> ();
+ flubber<int, int, int, long, int> ();
+ flubber<int, int, int, long, short> ();
+ flubber<int, int, int, long, long> ();
+ flubber<int, int, int, long, char> ();
+ flubber<int, int, int, char, int> ();
+ flubber<int, int, int, char, short> ();
+ flubber<int, int, int, char, long> ();
+ flubber<int, int, int, char, char> ();
+ flubber<int, int, short, int, int> ();
+ flubber<int, int, short, int, short> ();
+ flubber<int, int, short, int, long> ();
+ flubber<int, int, short, int, char> ();
+ flubber<int, int, short, short, int> ();
+ flubber<short, int, short, int, short> ();
+ flubber<long, short, long, short, long> ();
+
+ policy1 p1 (1);
+ p1.function ();
+ policy2 p2 (2);
+ p2.function ();
+ policy3 p3 (3);
+ p3.function ();
+ policy4 p4 (4);
+ p4.function ();
+
+ policyd1 pd1 (5);
+ pd1.function ();
+ policyd2 pd2 (6);
+ pd2.function ();
+ policyd3 pd3 (7);
+ pd3.function ();
+ policyd4 pd4 (d);
+ pd4.function ();
+ policyd5 pd5 (int_tclass);
+ pd5.function ();
+
+ base1 b1 (3);
+
+ r = a;
+ char* str = a;
+ fluff* flp = a;
+ fluff** flpp = a;
+}
+
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA 1/3] dwarf2_physname - cpexprs.exp
2009-11-20 21:08 [RFA 1/3] dwarf2_physname - cpexprs.exp Keith Seitz
@ 2009-11-21 5:21 ` Pedro Alves
2009-12-08 21:27 ` Keith Seitz
2009-11-21 17:12 ` Daniel Jacobowitz
1 sibling, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2009-11-21 5:21 UTC (permalink / raw)
To: gdb-patches; +Cc: Keith Seitz
On Friday 20 November 2009 21:07:49, Keith Seitz wrote:
> Running these tests on CVS HEAD currently gives (go ahead, try it: I
> dare you :-):
Oh, man,... you know one can't resist that!
> # of expected passes 77
> # of unexpected failures 54
> # of unresolved testcases 123
>
> Not good -- gdb crashes along the way.
That's what I get too.
> However, with this entire patchset applied, all 378 test in cpexprs.exp
> will pass.
FYI, with 'gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)' (ubuntu 8.04):
FAIL: gdb.cp/cpexprs.exp: print policyd4::policyd
FAIL: gdb.cp/cpexprs.exp: print policyd<base, operation_1<base> >::policyd
FAIL: gdb.cp/cpexprs.exp: list base::overload(base&) const
FAIL: gdb.cp/cpexprs.exp: list base::overload(char*) const
FAIL: gdb.cp/cpexprs.exp: list base::overload(int) const
FAIL: gdb.cp/cpexprs.exp: list base::overload(long) const
FAIL: gdb.cp/cpexprs.exp: list base::overload(short) const
FAIL: gdb.cp/cpexprs.exp: list base::overload(void) const
FAIL: gdb.cp/cpexprs.exp: list policyd4::policyd
FAIL: gdb.cp/cpexprs.exp: list policyd<base, operation_1<base> >::policyd
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(base&) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(base&) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(char*) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(char*) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(int) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(int) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(long) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(long) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(short) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(short) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(void) const
FAIL: gdb.cp/cpexprs.exp: continue to base::overload(void) const
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at policyd4::policyd
FAIL: gdb.cp/cpexprs.exp: continue to policyd4::policyd
FAIL: gdb.cp/cpexprs.exp: setting breakpoint at policyd<base, operation_1<base> >::policyd
FAIL: gdb.cp/cpexprs.exp: continue to policyd<base, operation_1<base> >::policyd
=== gdb Summary ===
# of expected passes 360
# of unexpected failures 26
/home/pedro/gdb/keithcpp/build/gdb/testsuite/../../gdb/gdb version 7.0.50.20091121-cvs -nw -nx
make[1]: *** [check-single] Error 1
make[1]: Leaving directory `/home/pedro/gdb/keithcpp/build/gdb/testsuite'
make: *** [check] Error 2
I've no idea if this is compiler badness or not. I haven't investigated.
I also saw 1 FAIL->PASS in classes.exp, 2 new PASS->FAILs and 2 new FAIL->PASSes
in namespace.exp.
--
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA 1/3] dwarf2_physname - cpexprs.exp
2009-11-21 5:21 ` Pedro Alves
@ 2009-12-08 21:27 ` Keith Seitz
0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2009-12-08 21:27 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On 11/20/2009 09:20 PM, Pedro Alves wrote:
> FAIL: gdb.cp/cpexprs.exp: print policyd4::policyd
> FAIL: gdb.cp/cpexprs.exp: print policyd<base, operation_1<base> >::policyd
> FAIL: gdb.cp/cpexprs.exp: list base::overload(base&) const
> FAIL: gdb.cp/cpexprs.exp: list base::overload(char*) const
> FAIL: gdb.cp/cpexprs.exp: list base::overload(int) const
> FAIL: gdb.cp/cpexprs.exp: list base::overload(long) const
> FAIL: gdb.cp/cpexprs.exp: list base::overload(short) const
> FAIL: gdb.cp/cpexprs.exp: list base::overload(void) const
> FAIL: gdb.cp/cpexprs.exp: list policyd4::policyd
> FAIL: gdb.cp/cpexprs.exp: list policyd<base, operation_1<base> >::policyd
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(base&) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(base&) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(char*) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(char*) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(int) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(int) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(long) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(long) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(short) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(short) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at base::overload(void) const
> FAIL: gdb.cp/cpexprs.exp: continue to base::overload(void) const
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at policyd4::policyd
> FAIL: gdb.cp/cpexprs.exp: continue to policyd4::policyd
> FAIL: gdb.cp/cpexprs.exp: setting breakpoint at policyd<base, operation_1<base> >::policyd
> FAIL: gdb.cp/cpexprs.exp: continue to policyd<base, operation_1<base> >::policyd
>
> I've no idea if this is compiler badness or not. I haven't investigated.
With FSF GCC 4.2.4, the only failures I see are the policyd4-related
ones. I suspect that this might be caused by the valops.c assumption
that Daniel recently corrected (my bad):
2009-12-04 Daniel Jacobowitz <dan@codesourcery.com>
* valops.c (value_struct_elt_for_reference): Do not rely on
field order.
> I also saw 1 FAIL->PASS in classes.exp, 2 new PASS->FAILs and 2 new FAIL->PASSes
> in namespace.exp.
We've already established the namespace.exp status, so what remains is
the new PASS in classes.exp, which I'm guessing is not a problem. :-)
Keith
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA 1/3] dwarf2_physname - cpexprs.exp
2009-11-20 21:08 [RFA 1/3] dwarf2_physname - cpexprs.exp Keith Seitz
2009-11-21 5:21 ` Pedro Alves
@ 2009-11-21 17:12 ` Daniel Jacobowitz
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2009-11-21 17:12 UTC (permalink / raw)
To: Keith Seitz; +Cc: gdb-patches
On Fri, Nov 20, 2009 at 01:07:49PM -0800, Keith Seitz wrote:
> Running these tests on CVS HEAD currently gives (go ahead, try it: I
> dare you :-):
My previous test run I botched patch application and didn't have this
test. I ran it seperately and found some problems.
print base1::base1(int)
$2 = {base1 *(base1 * const, int)} 0x9944 <base1::base1(int)>
(gdb) FAIL: gdb.cp/cpexprs.exp: print base1::base1(int)
I know what this one is - constructors on ARM return "this". The test
expects void. So this one is just a pattern matching problem.
print base::operator/=
A syntax error in expression, near `'.
(gdb) FAIL: gdb.cp/cpexprs.exp: print base::operator/=
This one is caused by using gdb_load, but not running the test to
main. If you have debug info for your startup code, and gdb_load
connects to your target, you'll end up in the language (asm or C) of
your startup code. I suggest an additional runto_main at the start of
the test so that the parsing language is C++.
That yields the attached incremental patch. The ctor/dtor bits are an
interesting question; we could canonicalize the type, but I don't
think it's necessary (or clear what to canonicalize *to*).
All 18 of the other fails in the GCC multilibs are of the form:
list base::overload(base&) const
Junk at end of line specification.
(gdb) FAIL: gdb.cp/cpexprs.exp: list base::overload(base&) const
What might that be?
Each RealView multilib has 309 failures. A sample:
-$1 = {void (const base1 * const)} 0x999c <base1::a_function() const>
-(gdb) PASS: gdb.cp/cpexprs.exp: print base1::a_function
+$1 = {void (const base1 *)} 0x11614 <base1::a_function() const>
+(gdb) FAIL: gdb.cp/cpexprs.exp: print base1::a_function
This tests for exact output on something which is up to the vagaries
of the producer :-( So this will require even more similar hacks.
RealView is my example here, but expect similar changes between GCC
versions.
And there's:
print flubber<int, int, int, char, short>
-$64 = {void (void)} 0xa100 <flubber<int, int, int, char, short>()>
-(gdb) PASS: gdb.cp/cpexprs.exp: print flubber<int, int, int, char,
short>
+No symbol "flubber<int, int, int, char, short>" in current context.
+(gdb) FAIL: gdb.cp/cpexprs.exp: print flubber<int, int, int, char,
short>
Something seems to be broken in RealView templates, but that's not a
problem with the test. So with this incremental patch (or something
similar), and whatever the "Junk at end of arguments" issue turns out
to be, these new tests look OK.
--
Daniel Jacobowitz
CodeSourcery
2009-11-21 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.cp/cpexprs.exp (escape): Delete. Change all callers
to use string_to_regexp.
(ctor, dtor): New functions. Use them to match constructor
and destructor function types.
(Top level): Use runto_main.
---
gdb/testsuite/gdb.cp/cpexprs.exp | 117 +++++++++++++++++++++++----------------
1 file changed, 69 insertions(+), 48 deletions(-)
Index: gdb-mainline/gdb/testsuite/gdb.cp/cpexprs.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.cp/cpexprs.exp 2009-11-21 08:16:14.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.cp/cpexprs.exp 2009-11-21 08:58:40.000000000 -0800
@@ -31,26 +31,13 @@ proc test_breakpoint {func} {
} else {
gdb_breakpoint "$func"
set i [expr {[string last : $func] + 1}]
- set efunc [escape [string range $func $i end]]
+ set efunc [string_to_regexp [string range $func $i end]]
gdb_test "continue" \
"Continuing.\r\n\r\nBreakpoint $DEC+,.*$efunc.*" \
"continue to $func"
}
}
-# Escape expect-reserved characters in the string
-proc escape {string} {
- regsub -all {\*} $string {\*} string
- regsub -all {\(} $string {\(} string
- regsub -all {\)} $string {\)} string
- regsub -all {\]} $string {\]} string
- regsub -all {\[} $string {\[} string
- regsub -all {\+} $string {\+} string
- regsub -all {\^} $string {\^} string
- regsub -all {\!} $string {\!} string
- return $string
-}
-
# Add a function to the list of tested functions
# FUNC is the name of the function (which will be passed to gdb commands)
# TYPE is the type of the function, as expected from the "print" command
@@ -76,11 +63,11 @@ proc add {func type print lst} {
set print [regsub {\(void\)} $print {()}]
set all_functions($func,print) \
- "$CONVAR = {[escape $type]} $ADDR <[escape $print].*>"
+ "$CONVAR = {[string_to_regexp $type]} $ADDR <[string_to_regexp $print].*>"
if {$lst == "-"} {
set lst "$func"
}
- set all_functions($func,list) ".*// [escape $lst]"
+ set all_functions($func,list) ".*// [string_to_regexp $lst]"
}
proc get {func cmd} {
@@ -145,34 +132,63 @@ add {base2::a_function} \
-
# Constructors
+
+# On targets using the ARM EABI, the constructor is expected to return
+# "this".
+proc ctor { type arglist } {
+ if { [istarget arm*-*eabi*] } {
+ set ret "$type *"
+ } else {
+ set ret "void "
+ }
+ if { $arglist != "" } {
+ set arglist ", $arglist"
+ }
+ return "${ret}($type * const$arglist)"
+}
+
add {derived::derived} \
- {void (derived * const)} \
+ [ctor derived ""] \
- \
-
add {base1::base1(void)} \
- {void (base1 * const, const void ** const)} \
+ [ctor base1 "const void ** const"] \
- \
-
add {base1::base1(int)} \
- {void (base1 * const, int)} \
+ [ctor base1 "int"] \
- \
-
add {base2::base2} \
- {void (base2 * const, const void ** const)} \
+ [ctor base2 "const void ** const"] \
- \
-
add {base::base(void)} \
- {void (base * const)} \
+ [ctor base ""] \
- \
-
add {base::base(int)} \
- {void (base * const, int)} \
- - \
+ [ctor base "int"] \
- \
+ -
# Destructors
+
+# On targets using the ARM EABI, some destructors are expected
+# to return "this". Others are void. For internal reasons,
+# GCC returns void * instead of $type *; RealView appears to do
+# the same.
+proc dtor { type } {
+ if { [istarget arm*-*eabi*] } {
+ set ret "void *"
+ } else {
+ set ret "void "
+ }
+ return "${ret}($type * const)"
+}
+
add {base::~base} \
- {void (base * const)} \
+ [dtor base] \
- \
-
@@ -499,19 +515,19 @@ add {tclass<base>::do_something} \
- \
{tclass<T>::do_something}
add {policy1::policy} \
- {void (policy<int, operation_1<void*> > * const, int)} \
+ [ctor "policy<int, operation_1<void*> >" "int"] \
{policy<int, operation_1<void*> >::policy} \
{policy<T, Policy>::policy}
add {policy2::policy} \
- {void (policy<int, operation_2<void*> > * const, int)} \
+ [ctor "policy<int, operation_2<void*> >" int] \
{policy<int, operation_2<void*> >::policy} \
{policy<T, Policy>::policy}
add {policy3::policy} \
- {void (policy<int, operation_3<void*> > * const, int)} \
+ [ctor "policy<int, operation_3<void*> >" "int"] \
{policy<int, operation_3<void*> >::policy} \
{policy<T, Policy>::policy}
add {policy4::policy} \
- {void (policy<int, operation_4<void*> > * const, int)} \
+ [ctor "policy<int, operation_4<void*> >" "int"] \
{policy<int, operation_4<void*> >::policy} \
{policy<T, Policy>::policy}
add {policy1::function} \
@@ -531,83 +547,83 @@ add {policy4::function} \
{operation_4<void*>::function} \
{operation_4<T>::function}
add {policyd<int, operation_1<int> >::policyd} \
- {void (policyd<int, operation_1<int> > * const, int)} \
+ [ctor "policyd<int, operation_1<int> >" "int"] \
- \
{policyd<T, Policy>::policyd}
add {policyd1::policyd} \
- {void (policyd<int, operation_1<int> > * const, int)} \
+ [ctor "policyd<int, operation_1<int> >" "int"] \
{policyd<int, operation_1<int> >::policyd} \
{policyd<T, Policy>::policyd}
add {policyd<int, operation_1<int> >::~policyd} \
- {void (policyd<int, operation_1<int> > * const)} \
+ [dtor "policyd<int, operation_1<int> >"] \
- \
{policyd<T, Policy>::~policyd}
add {policyd1::~policyd} \
- {void (policyd<int, operation_1<int> > * const)} \
+ [dtor "policyd<int, operation_1<int> >"] \
{policyd<int, operation_1<int> >::~policyd} \
{policyd<T, Policy>::~policyd}
add {policyd<long, operation_1<long> >::policyd} \
- {void (policyd<long, operation_1<long> > * const, long)} \
+ [ctor "policyd<long, operation_1<long> >" "long"] \
- \
{policyd<T, Policy>::policyd}
add {policyd2::policyd} \
- {void (policyd<long, operation_1<long> > * const, long)} \
+ [ctor "policyd<long, operation_1<long> >" "long"] \
{policyd<long, operation_1<long> >::policyd} \
{policyd<T, Policy>::policyd}
add {policyd<long, operation_1<long> >::~policyd} \
- {void (policyd<long, operation_1<long> > * const)} \
+ [dtor "policyd<long, operation_1<long> >"] \
- \
{policyd<T, Policy>::~policyd}
add {policyd2::~policyd} \
- {void (policyd<long, operation_1<long> > * const)} \
+ [dtor "policyd<long, operation_1<long> >"] \
{policyd<long, operation_1<long> >::~policyd} \
{policyd<T, Policy>::~policyd}
add {policyd<char, operation_1<char> >::policyd} \
- {void (policyd<char, operation_1<char> > * const, char)} \
+ [ctor "policyd<char, operation_1<char> >" "char"] \
- \
{policyd<T, Policy>::policyd}
add {policyd3::policyd} \
- {void (policyd<char, operation_1<char> > * const, char)} \
+ [ctor "policyd<char, operation_1<char> >" "char"] \
{policyd<char, operation_1<char> >::policyd} \
{policyd<T, Policy>::policyd}
add {policyd<char, operation_1<char> >::~policyd} \
- {void (policyd<char, operation_1<char> > * const)} \
+ [dtor "policyd<char, operation_1<char> >"] \
- \
{policyd<T, Policy>::~policyd}
add {policyd3::~policyd} \
- {void (policyd<char, operation_1<char> > * const)} \
+ [dtor "policyd<char, operation_1<char> >"] \
{policyd<char, operation_1<char> >::~policyd} \
{policyd<T, Policy>::~policyd}
add {policyd<base, operation_1<base> >::policyd} \
- {void (policyd<base, operation_1<base> > * const, base)} \
+ [ctor "policyd<base, operation_1<base> >" "base"] \
- \
{policyd<T, Policy>::policyd}
add {policyd4::policyd} \
- {void (policyd<base, operation_1<base> > * const, base)} \
+ [ctor "policyd<base, operation_1<base> >" "base"] \
{policyd<base, operation_1<base> >::policyd} \
{policyd<T, Policy>::policyd}
add {policyd<base, operation_1<base> >::~policyd} \
- {void (policyd<base, operation_1<base> > * const)} \
+ [dtor "policyd<base, operation_1<base> >"] \
- \
{policyd<T, Policy>::~policyd}
add {policyd4::~policyd} \
- {void (policyd<base, operation_1<base> > * const)} \
+ [dtor "policyd<base, operation_1<base> >"] \
{policyd<base, operation_1<base> >::~policyd} \
{policyd<T, Policy>::~policyd}
add {policyd<tclass<int>, operation_1<tclass<int> > >::policyd} \
- {void (policyd<tclass<int>, operation_1<tclass<int> > > * const, tclass<int>)} \
+ [ctor "policyd<tclass<int>, operation_1<tclass<int> > >" "tclass<int>"] \
- \
{policyd<T, Policy>::policyd}
add {policyd5::policyd} \
- {void (policyd<tclass<int>, operation_1<tclass<int> > > * const, tclass<int>)} \
+ [ctor "policyd<tclass<int>, operation_1<tclass<int> > >" "tclass<int>"] \
{policyd<tclass<int>, operation_1<tclass<int> > >::policyd} \
{policyd<T, Policy>::policyd}
add {policyd<tclass<int>, operation_1<tclass<int> > >::~policyd} \
- {void (policyd<tclass<int>, operation_1<tclass<int> > > * const)} \
+ [dtor "policyd<tclass<int>, operation_1<tclass<int> > >"] \
- \
{policyd<T, Policy>::~policyd}
add {policyd5::~policyd} \
- {void (policyd<tclass<int>, operation_1<tclass<int> > > * const)} \
+ [dtor "policyd<tclass<int>, operation_1<tclass<int> > >"] \
{policyd<tclass<int>, operation_1<tclass<int> > >::~policyd} \
{policyd<T, Policy>::~policyd}
add {policyd<int, operation_1<int> >::function} \
@@ -679,6 +695,11 @@ gdb_start
gdb_reinitialize_dir [file join $srcdir $subdir]
gdb_load $binfile
+if {![runto_main]} {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
# Set the listsize to one. This will help with testing "list".
gdb_test "set listsize 1"
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-08 21:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-20 21:08 [RFA 1/3] dwarf2_physname - cpexprs.exp Keith Seitz
2009-11-21 5:21 ` Pedro Alves
2009-12-08 21:27 ` Keith Seitz
2009-11-21 17:12 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox