URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-src/gdb-7.2/gdb-7.2-or32-1.0rc3/gdb/testsuite/gdb.cp
- from Rev 330 to Rev 513
- ↔ Reverse comparison
Rev 330 → Rev 513
/mb-inline1.cc
0,0 → 1,35
/* Test gdb support for setting file:line breakpoints on inline fns. |
|
This testcase is part of GDB, the GNU debugger. |
|
Copyright 2008, 2009, 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/>. |
*/ |
|
#include "mb-inline.h" |
|
int |
afn () |
{ |
return foo (0) + multi_line_foo (0); |
} |
|
int |
main () |
{ |
int a = afn (); |
int b = bfn (); |
return a * b; |
} |
/call-c.cc
0,0 → 1,46
/* This test script is part of GDB, the GNU debugger. |
|
Copyright 2006, 2007, 2008, 2009, 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/>. |
*/ |
|
int func(int x) |
{ |
return x; |
} |
|
struct Foo { |
Foo() : x_(1) { } |
int func() const { return x_; } |
private: |
int x_; |
}; |
|
typedef Foo *FooHandle; |
|
extern "C" { |
int foo(int); |
} |
|
int main() |
{ |
Foo f; |
Foo *pf = &f; |
Foo* &rf = pf; |
FooHandle handle = pf; |
rf->func(); /* set breakpoint here */ |
foo(0); |
return func(0); |
} |
/cttiadd2.cc
0,0 → 1,41
/* This testcase is part of GDB, the GNU debugger. |
|
Copyright 1998, 1999, 2004, 2007, 2008, 2009, 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/>. |
*/ |
|
template<class T> T add2(T v1, T v2) |
{ |
T v3; |
v3 = v1; |
v3 += v2; |
return v3; |
} |
|
void subr2() |
{ |
unsigned char c; |
int i; |
float f; |
|
c = 'b'; |
i = 3; |
f = 6.5; |
|
c = add2(c, c); |
i = add2(i, i); |
f = add2(f, f); |
} |
/hang1.cc
0,0 → 1,6
#include "hang.H" |
|
extern int dummy2 (void); |
extern int dummy3 (void); |
|
int main (int argc, char **argv) { return dummy2() + dummy3(); } |
/abstract-origin.exp
0,0 → 1,31
# Copyright 2009, 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/>. |
|
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.*" |
/local.exp
0,0 → 1,308
# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009, 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/>. |
|
# tests for local variables |
# Written by Satish Pai <pai@apollo.hp.com> 1997-07-08 |
# Cleaned by Michael Chastain <mec@shout.net> 2002-04-08 |
|
|
# This file is part of the gdb testsuite |
|
set ws "\[\r\n\t \]+" |
set nl "\[\r\n\]+" |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
# |
# test running programs |
# |
|
if { [skip_cplus_tests] } { continue } |
|
set testfile "local" |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested local.exp |
return -1 |
} |
|
if [get_compiler_info $binfile "c++"] { |
return -1 |
} |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
|
# |
# set it up at a breakpoint so we can play with the variable values |
# |
if ![runto_main] then { |
perror "couldn't run to breakpoint" |
continue |
} |
|
if ![runto 'marker1'] then { |
perror "couldn't run to marker1" |
continue |
} |
|
gdb_test "up" ".*foobar.*" "up from marker1" |
|
set sep "(\[.\]|___)\[0-9\]" |
|
# ptype on a local variable. |
# |
# This test has six arms. The first three arms accept normal output: |
# no synthetic methods; synthetic methods before user methods; |
# synthetic methods after user methods. |
# |
# The next two arms accept "foobar__Fi.0::Local" instead of "Local". |
# This is a bug. It happens in various places with various versions of |
# gcc and gdb and various debugging types. |
# |
# The last arm accepts the user methods in duplicate. This bug happens |
# with gcc 3.3.2 -gdwarf-2, and has been fixed in gcc HEAD 2004-01-22. |
# |
# -- chastain 2004-01-24 |
|
set re_class "((struct|class) Local \{${ws}public:|struct Local \{)" |
set re_fields "int loc1;" |
set re_methods "char loc_foo\\(char\\);" |
set re_synth_gcc_23 "Local & operator=\\(Local const ?&\\);${ws}Local\\(Local const ?&\\);${ws}Local\\((void|)\\);" |
|
set XX_class "((struct|class) foobar__Fi.0::Local \{${ws}public:|struct foobar__Fi.0:Local \{)" |
set XX_synth_gcc_2 "Local & operator=\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\((void|)\\);" |
set YY_methods "$re_methods${ws}$re_methods" |
|
set name "ptype l" |
gdb_test_multiple "ptype l" $name { |
-re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 2.95.3, dwarf-2 |
# gdb 6.0, gcc HEAD 2004-01-22, dwarf-2 |
# gdb HEAD 2004-01-23, gcc HEAD 2004-01,22, dwarf-2 |
pass "$name" |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 3.3.2, stabs+ |
# gdb HEAD 2004-01-23, gcc 3.3.2, stabs+ |
pass "$name" |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc HEAD 2004-01-22, stabs+ |
# gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+ |
pass "$name" |
} |
-re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2 |
kfail "gdb/1516" "$name" |
} |
-re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 2.95.3, stabs+ |
# gdb HEAD 2004-01-23, gcc 2.95.3, stabs+ |
kfail "gdb/1516" "$name" |
} |
-re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 3.3.2, dwarf-2 |
# gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2 |
kfail "gdb/483" "$name" |
} |
} |
|
# This is the same test with "ptype Local" (the type name) |
# instead of "ptype l" (the variable name). |
|
set name "ptype Local" |
gdb_test_multiple "ptype Local" $name { |
-re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 2.95.3, dwarf-2 |
# gdb 6.0, gcc HEAD 2004-01-22, dwarf-2 |
# gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, dwarf-2 |
pass "$name" |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 3.3.2, stabs+ |
# gdb HEAD 2004-01-23, gcc 3.3.2, stabs+ |
pass "$name" |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc HEAD 2004-01-22, stabs+ |
# gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+ |
pass "$name" |
} |
-re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
kfail "gdb/1516" "$name" |
} |
-re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 2.95.3, stabs+ |
# gdb HEAD 2004-01-23, gcc 2.95.3, stabs+ |
kfail "gdb/1516" "$name" |
} |
-re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" { |
# gdb 6.0, gcc 3.3.2, dwarf-2 |
# gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2 |
kfail "gdb/483" "$name" |
} |
-re "No symbol \"Local\" in current context.$nl$gdb_prompt $" { |
# gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2 |
fail "$name" |
} |
} |
|
gdb_test "break marker2" |
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2.*" \ |
"continuing to marker2" |
|
gdb_test "up" ".*main.*" "up from marker2" |
|
# Make sure that `Local' isn't in scope here; it's local to foobar. |
# setup_kfail "gdb/825" |
|
set eol "\[\t \]*\[\r\n\]+\[\t \]*" |
gdb_test_multiple "ptype Local" "Local out of scope" { |
-re "No symbol \"Local\" in current context.*${gdb_prompt} $" { |
pass "Local out of scope" |
} |
-re "ptype Local${eol}type = class Local {${eol} public:${eol} int loc1;${eol}.*${eol} char loc_foo\\(char\\);${eol}}${eol}${gdb_prompt} " { |
# GCC emits STABS debugging information in a way that doesn't |
# properly preserve the scoping of local classes. I think |
# we'd need to start using Sun's extensions to stabs to get |
# this right. |
kfail gdb/825 "Local out of scope" |
} |
-re "ptype Local${eol}type = class Local {${eol} public:${eol} int loc1;${eol} char loc_foo\\(char\\);${eol}.*${eol}}${eol}${gdb_prompt} " { |
# gcc 3.X abi-2 -gstabs+ |
kfail gdb/825 "Local out of scope" |
} |
} |
|
|
# DTS CLLbs14316 and CLLbs17058 |
# coulter - I added a clause for HP's aCC compiler. We print out the type |
# as xx instead of const unsigned char, but we still have an expected failure |
# because of two reasons: |
# There is a number at the end of InnerLocal4 which should not be there, |
# DTS CLLbs14316 |
# The line number for the class |
# setup_xfail "hppa*-*-*" CLLbs14316 |
|
# --- |
# Pattern 1: |
# PASS |
# dwarf-2 |
# 2.95.3, 2.96-rh, 3.0.4, 3.1, gcc-3_1-branch, HEAD |
# |
# Pattern 2: |
# PASS |
# stabs+ |
# 2.95.3, 2.96-rh, 3.0.4, 3.1, gcc-3_1-branch, HEAD |
# |
# Pattern 3: |
# Old hppa pattern. |
# |
# Pattern 4: |
# Old hppa pattern. |
# |
# chastain 2002-05-27 |
|
# Pattern 5: |
# PASS |
# stabs+ |
# HEAD |
# |
# chastain 2004-01-02 |
|
gdb_test_multiple "ptype InnerLocal" "ptype InnerLocal" { |
-re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*(InnerLocal::|)NestedInnerLocal nest1;\[\r\n\t \]*int il_foo\\((unsigned char const|const unsigned char) *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { |
pass "ptype InnerLocal (pattern 1)" |
} |
-re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*(InnerLocal::|)NestedInnerLocal nest1;\[\r\n\t \]*InnerLocal *& operator *=\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((void|)\\);\[\r\n\t \]*int il_foo\\(unsigned char const *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { |
pass "ptype InnerLocal (pattern 2)" |
} |
-re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { |
pass "ptype InnerLocal (old HP aCC)" |
} |
-re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal4::NestedInnerLocal nest1;\r\n\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\\(Local at.*local\.cc:\[0-9\]+\\)\r\n\}.*$gdb_prompt $" { |
pass "ptype InnerLocal (old HP aCC)" |
} |
-re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*(InnerLocal::|)NestedInnerLocal nest1;\[\r\n\t \]* int il_foo\\(unsigned char const *&\\);\[\r\n\t \]*InnerLocal *& operator *=\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((void|)\\);\[\r\n\t \]*\}.*$gdb_prompt $" { |
pass "ptype InnerLocal (pattern 5)" |
} |
} |
|
#--- |
# Pattern 1: |
# PASS |
# dwarf-2 |
# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD |
# |
# Pattern 2: |
# PASS |
# stabs+ |
# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD |
# |
# chastain 2002-04-08 |
|
# NOTE (2004-02-24, carlton): This test really is invalid - |
# 'NestedInnerLocal' shouldn't be visible, so only the third |
# expression should count as a pass. I'm leaving in the earlier |
# passes, however, given the current problematic state of our local |
# class support, but once we fix PR gdb/482, we should delete this |
# test. |
|
gdb_test_multiple "ptype NestedInnerLocal" "ptype NestedInnerLocal" { |
-re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { |
pass "ptype NestedInnerLocal" |
} |
-re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { |
pass "ptype NestedInnerLocal" |
} |
-re "No symbol \"NestedInnerLocal\" in current context\.\r\n$gdb_prompt $" { |
pass "ptype NestedInnerLocal" |
} |
} |
|
set re_class "((struct|class) InnerLocal::NestedInnerLocal \{${ws}public:|struct InnerLocal::NestedInnerLocal \{)" |
set re_fields "int nil;" |
set re_methods "int nil_foo\\(int\\);" |
set re_synth_gcc_23 "InnerLocal::NestedInnerLocal & operator=\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(\\);" |
|
set name "ptype InnerLocal::NestedInnerLocal" |
gdb_test_multiple "ptype InnerLocal::NestedInnerLocal" $name { |
-re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { |
# gcc -gdwarf-2 should produce this but does not yet |
pass $name |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods${ws}$nl\}$nl$gdb_prompt $" { |
# gcc 2.95.3 -gstabs+ |
# gcc v3 -gstabs+, abi 1 |
pass $name |
} |
-re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" { |
# gcc v3 -gstabs+, abi 2 |
pass $name |
} |
-re "There is no field named NestedInnerLocal.*$gdb_prompt $" { |
# gcc v3 -gdwarf-2 |
kfail "gdb/482" $name |
} |
} |
/m-static1.cc
0,0 → 1,5
// 2002-08-16 |
|
#include "m-static.h" |
|
const int gnu_obj_4::elsewhere = 221; |
/ambiguous.exp
0,0 → 1,233
# Copyright 1998, 1999, 2003, 2004, 2007, 2008, 2009, 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/>. |
|
# This file is part of the gdb testsuite |
|
# tests relating to ambiguous class members |
# Written by Satish Pai <pai@apollo.hp.com> 1997-07-28 |
|
# This file is part of the gdb testsuite |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
# |
# test running programs |
# |
|
|
if { [skip_cplus_tests] } { continue } |
|
set testfile "ambiguous" |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
|
if [get_compiler_info ${binfile} "c++"] { |
return -1; |
} |
|
if { [test_compiler_info gcc-*] } then { continue } |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested ambiguous.exp |
return -1 |
} |
|
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
|
# |
# set it up at a breakpoint so we can play with the variable values |
# |
if ![runto_main] then { |
perror "couldn't run to breakpoint" |
continue |
} |
|
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" |
send_gdb "cont\n" |
gdb_expect { |
-re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { |
send_gdb "up\n" |
gdb_expect { |
-re ".*$gdb_prompt $" { pass "up from marker1" } |
timeout { fail "up from marker1" } |
} |
} |
-re "$gdb_prompt $" { fail "continue to marker1" } |
timeout { fail "(timeout) continue to marker1" } |
} |
|
# print out various class objects' members. The values aren't |
# important, just check that the warning is emitted at the |
# right times. |
|
# X is derived from A1 and A2; both A1 and A2 have a member 'x' |
send_gdb "print x.x\n" |
gdb_expect { |
-re "warning: x ambiguous; using X::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print x.x" |
} |
-re "warning: x ambiguous; using X::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print x.x" |
} |
-re ".*$gdb_prompt $" { fail "print x.x" } |
timeout { fail "(timeout) print x.x" } |
} |
|
|
# N is derived from A1 and A2, but not immediately -- two steps |
# up in the hierarchy. Both A1 and A2 have a member 'x'. |
send_gdb "print n.x\n" |
gdb_expect { |
-re "warning: x ambiguous; using N::M::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print n.x" |
} |
-re "warning: x ambiguous; using N::L::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print n.x" |
} |
-re ".*$gdb_prompt $" { fail "print n.x" } |
timeout { fail "(timeout) print n.x" } |
} |
|
# J is derived from A1 twice. A1 has a member x. |
send_gdb "print j.x\n" |
gdb_expect { |
-re "warning: x ambiguous; using J::L::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print j.x" |
} |
-re "warning: x ambiguous; using J::K::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print j.x" |
} |
-re ".*$gdb_prompt $" { fail "print j.x" } |
timeout { fail "(timeout) print j.x" } |
} |
|
# JV is derived from A1 but A1 is a virtual base. Should not |
# report an ambiguity in this case. |
send_gdb "print jv.x\n" |
gdb_expect { |
-re "warning: x ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
fail "print jv.x (ambiguity reported)" |
} |
-re "\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { pass "print jv.x" } |
-re ".*$gdb_prompt $" { fail "print jv.x (??)" } |
timeout { fail "(timeout) print jv.x" } |
} |
|
# JVA1 is derived from A1; A1 occurs as a virtual base in two |
# ancestors, and as a non-virtual immediate base. Ambiguity must |
# be reported. |
send_gdb "print jva1.x\n" |
gdb_expect { |
-re "warning: x ambiguous; using JVA1::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print jva1.x" |
} |
-re "warning: x ambiguous; using JVA1::KV::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print jva1.x" |
} |
-re ".*$gdb_prompt $" { fail "print jva1.x" } |
timeout { fail "(timeout) print jva1.x" } |
} |
|
# JVA2 is derived from A1 & A2; A1 occurs as a virtual base in two |
# ancestors, and A2 is a non-virtual immediate base. Ambiguity must |
# be reported as A1 and A2 both have a member 'x'. |
send_gdb "print jva2.x\n" |
gdb_expect { |
-re "warning: x ambiguous; using JVA2::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print jva2.x" |
} |
-re "warning: x ambiguous; using JVA2::KV::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
pass "print jva2.x" |
} |
-re ".*$gdb_prompt $" { fail "print jva2.x" } |
timeout { fail "(timeout) print jva2.x" } |
} |
|
# JVA1V is derived from A1; A1 occurs as a virtual base in two |
# ancestors, and also as a virtual immediate base. Ambiguity must |
# not be reported. |
send_gdb "print jva1v.x\n" |
gdb_expect { |
-re "warning: x ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { |
fail "print jva1v.x (ambiguity reported)" |
} |
-re "\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { pass "print jva1v.x" } |
-re ".*$gdb_prompt $" { fail "print jva1v.x (??)" } |
timeout { fail "(timeout) print jva1v.x" } |
} |
|
# Now check for ambiguous bases. |
|
# J is derived from A1 twice; report ambiguity if a J is |
# cast to an A1. |
send_gdb "print (A1)j\n" |
gdb_expect { |
-re "warning: A1 ambiguous; using J::L::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
pass "print (A1)j" |
} |
-re "warning: A1 ambiguous; using J::K::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
pass "print (A1)j" |
} |
-re ".*$gdb_prompt $" { fail "print (A1)j" } |
timeout { fail "(timeout) print (A1)j" } |
} |
|
# JV is derived from A1 twice, but A1 is a virtual base; should |
# not report ambiguity when a JV is cast to an A1. |
send_gdb "print (A1)jv\n" |
gdb_expect { |
-re "warning: A1 ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
fail "print (A1)jv (ambiguity reported)" |
} |
-re "\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { pass "print (A1)jv" } |
-re ".*$gdb_prompt $" { fail "print (A1)jv (??)" } |
timeout { fail "(timeout) print (A1)jv" } |
} |
|
# JVA1 is derived from A1; A1 is a virtual base and also a |
# non-virtual base. Must report ambiguity if a JVA1 is cast to an A1. |
send_gdb "print (A1)jva1\n" |
gdb_expect { |
-re "warning: A1 ambiguous; using JVA1::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
pass "print (A1)jva1" |
} |
-re "warning: A1 ambiguous; using JVA1::KV::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
pass "print (A1)jva1" |
} |
-re ".*$gdb_prompt $" { fail "print (A1)jva1" } |
timeout { fail "(timeout) print (A1)jva1" } |
} |
|
# JVA1V is derived from A1; A1 is a virtual base indirectly |
# and also directly; must not report ambiguity when a JVA1V is cast to an A1. |
send_gdb "print (A1)jva1v\n" |
gdb_expect { |
-re "warning: A1 ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { |
fail "print (A1)jva1v (ambiguity reported)" |
} |
-re "\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { pass "print (A1)jva1v" |
} |
-re ".*$gdb_prompt $" { fail "print (A1)jva1v (??)" } |
timeout { fail "(timeout) print (A1)jva1v" } |
} |
|
/bool.exp
0,0 → 1,49
# Copyright (C) 2006, 2007, 2008, 2009, 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/>. |
|
# Please email any bugs, comments, and/or additions to this file to: |
# bug-gdb@gnu.org |
|
# This file is part of the gdb testsuite. |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
# Test returning bool. |
|
if { [skip_cplus_tests] } { continue } |
|
|
set testfile "bool" |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested bool.exp |
return -1 |
} |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
runto_main |
|
# Testcases for tdep/2075. |
|
gdb_test "print return_true()" "\\$.* = true" |
gdb_test "print return_false()" "\\$.* = false" |
/namespace.exp
0,0 → 1,285
# Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009, 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/>. |
|
# tests for namespaces |
# Originally written by Satish Pai <pai@apollo.hp.com> 1997-07-23 |
|
# This file is part of the gdb testsuite |
|
# Note: The original tests were geared to the HP aCC compiler, |
# which has an idiosyncratic way of emitting debug info |
# for namespaces. |
# Note: As of 2000-06-03, they passed under g++ - djb |
|
|
if $tracelevel then { |
strace $tracelevel |
} |
|
|
if { [skip_cplus_tests] } { continue } |
|
set testfile "namespace" |
set srcfile ${testfile}.cc |
set objfile ${objdir}/${subdir}/${testfile}.o |
set srcfile1 ${testfile}1.cc |
set objfile1 ${objdir}/${subdir}/${testfile}1.o |
set binfile ${objdir}/${subdir}/${testfile} |
|
if [get_compiler_info ${binfile} c++] { |
return -1; |
} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } { |
untested namespace.exp |
return -1 |
} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${objfile1}" object {debug c++}] != "" } { |
untested namespace.exp |
return -1 |
} |
|
if { [gdb_compile "${objfile} ${objfile1}" "${binfile}" executable {debug c++}] != "" } { |
untested namespace.exp |
return -1 |
} |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
|
# |
# set it up at a breakpoint so we can play with the variable values |
# |
if ![runto_main] then { |
perror "couldn't run to breakpoint" |
continue |
} |
|
if ![runto 'marker1'] then { |
perror "couldn't run to marker1" |
continue |
} |
|
gdb_test "up" ".*main.*" "up from marker1" |
|
# Access a data item inside a namespace using colons and |
# single quotes. :-( |
|
# NOTE: carlton/2003-09-24: the quotes are becoming less necessary (or |
# even desirable.) For tests where it should still work with quotes, |
# I'm including versions both with and without quotes; for tests that |
# shouldn't work with quotes, I'm only including one version. |
|
gdb_test "print 'AAA::c'" \ |
"\\$\[0-9\]* = 0 '\\\\(0|000)'" \ |
"print 'AAA::c'" |
|
gdb_test "print AAA::c" \ |
"\\$\[0-9\]* = 0 '\\\\(0|000)'" \ |
"print AAA::c" |
|
# An object declared using "using". |
|
gdb_test "print ina" "\\$\[0-9\]+ = {xx = 33}" |
|
gdb_test_multiple "ptype ina" "ptype ina" { |
-re "type = class (AAA::|)inA \{\r\n\[ \]*public:\r\n\[ \]*int xx;\r\n\[ \]*\r\n\[ \]*.*int fum\\(int\\);\r\n\}\r\n$gdb_prompt $" { |
pass "ptype ina" |
} |
-re "type = class (AAA::|)inA \{\r\n\[ \]*public:\r\n\[ \]*int xx;\r\n\[ \]*\r\n\[ \]*int fum\\(int\\);\r\n.*\}\r\n$gdb_prompt $" { |
pass "ptype ina" |
} |
} |
|
# Check all functions are known to GDB |
|
setup_xfail hppa*-*-*11* CLLbs14869 |
gdb_test_multiple "info func xyzq" "info func xyzq" { |
-re "All functions.*File.*namespace.cc:\r\nint AAA::A_xyzq\\(int\\);\r\nint BBB::B_xyzq\\(int\\);\r\nchar AAA::xyzq\\(char\\);\r\nchar BBB::xyzq\\(char\\);\r\nchar BBB::CCC::xyzq\\(char\\);\r\nchar BBB::Class::xyzq\\(char\\);\r\n$gdb_prompt $" { |
pass "info func xyzq" |
} |
-re "All functions.*File.*namespace.cc:\r\nint AAA::A_xyzq\\(int\\);\r\nchar AAA::xyzq\\(char\\);\r\nint BBB::B_xyzq\\(int\\);\r\nchar BBB::CCC::xyzq\\(char\\);\r\nchar BBB::Class::xyzq\\(char\\);\r\nchar BBB::xyzq\\(char\\);\r\n$gdb_prompt $" { |
pass "info func xyzq" |
} |
} |
|
# Call a function in a namespace |
|
gdb_test "print 'AAA::xyzq'('x')" \ |
"\\$\[0-9\]* = 97 'a'" \ |
"print 'AAA::xyzq'('x')" |
|
gdb_test "print AAA::xyzq('x')" \ |
"\\$\[0-9\]* = 97 'a'" \ |
"print AAA::xyzq('x')" |
|
# Break on a function in a namespace |
|
gdb_test "break AAA::xyzq" \ |
"Breakpoint.*at $hex: file.*namespace.cc, line 47\\." |
|
# Call a function in a nested namespace |
|
gdb_test "print 'BBB::CCC::xyzq'('x')" \ |
"\\$\[0-9\]* = 122 'z'" \ |
"print 'BBB::CCC::xyzq'('x')" |
|
gdb_test "print BBB::CCC::xyzq('x')" \ |
"\\$\[0-9\]* = 122 'z'" \ |
"print BBB::CCC::xyzq('x')" |
|
# Break on a function in a nested namespace |
|
gdb_test "break BBB::CCC::xyzq" \ |
"Breakpoint.*at $hex: file.*namespace.cc, line 63\\." |
|
# Print address of a function in a class in a namespace |
|
gdb_test "print 'BBB::Class::xyzq'" \ |
"\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>" \ |
"print 'BBB::Class::xyzq'" |
|
gdb_test "print BBB::Class::xyzq" \ |
"\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>" \ |
"print BBB::Class::xyzq" |
|
# Break on a function in a class in a namespace |
|
gdb_test "break BBB::Class::xyzq" \ |
"Breakpoint.*at $hex: file.*namespace.cc, line 68\\." |
|
# Tests accessing static elements in namespace of other file. |
|
gdb_test "whatis C::cOtherFileType" "type = short" |
gdb_test "whatis ::C::cOtherFileType" "type = short" |
gdb_test "whatis C::cOtherFileVar" "type = const C::cOtherFileType" |
gdb_test "whatis ::C::cOtherFileVar" "type = const C::cOtherFileType" |
gdb_test "print C::cOtherFileVar" "\\$\[0-9\].* = 319" |
gdb_test "print ::C::cOtherFileVar" "\\$\[0-9\].* = 319" |
|
if {[test_compiler_info {gcc-[0-3]-*}] |
|| [test_compiler_info {gcc-4-[0-4]-*}]} { |
# The type in class is missing in older GCCs. |
setup_xfail *-*-* |
} |
gdb_test "whatis C::OtherFileClass::cOtherFileClassType" "type = short" |
if {[test_compiler_info {gcc-[0-3]-*}] |
|| [test_compiler_info {gcc-4-[0-4]-*}]} { |
# The type in class is missing in older GCCs. |
setup_xfail *-*-* |
} |
gdb_test "whatis ::C::OtherFileClass::cOtherFileClassType" "type = short" |
gdb_test "print C::OtherFileClass::cOtherFileClassVar" " = 318" |
|
# FSF GCC <=4.4 creates unqualified DIE "cOtherFileClassVar" ignoring the |
# namespace the same way older GDB did. |
set test "print ::cOtherFileClassVar" |
set test2 "print ::C::OtherFileClass::cOtherFileClassVar" |
gdb_test_multiple $test $test { |
-re "No symbol \"cOtherFileClassVar\" in current context\\.\r\n$gdb_prompt $" { |
pass $test |
|
gdb_test $test2 " = 318" |
} |
-re "\\$\[0-9\].* = 318\r\n$gdb_prompt $" { |
if {[test_compiler_info {gcc-[0-3]-*}] |
|| [test_compiler_info {gcc-4-[0-4]-*}]} { |
# Do not permit to XFAIL on recent GCCs. |
setup_xfail *-*-* |
} |
fail $test |
|
unresolved $test2 |
} |
} |
|
# Test to see if the appropriate namespaces are in scope when trying |
# to print out stuff from within a function defined within a |
# namespace. |
|
if ![runto "C::D::marker2"] then { |
perror "couldn't run to marker2" |
continue |
} |
|
gdb_test "print c" "\\$\[0-9\].* = 1" |
gdb_test "print cc" "No symbol \"cc\" in current context." |
gdb_test "print 'C::cc'" "\\$\[0-9\].* = 2" |
gdb_test "print C::cc" "\\$\[0-9\].* = 2" |
gdb_test "print cd" "\\$\[0-9\].* = 3" |
gdb_test "print C::D::cd" "No type \"D\" within class or namespace \"C::C\"." |
gdb_test "print 'E::cde'" "\\$\[0-9\].* = 5" |
gdb_test "print E::cde" "\\$\[0-9\].* = 5" |
gdb_test "print shadow" "\\$\[0-9\].* = 13" |
gdb_test "print E::ce" "No symbol \"ce\" in namespace \"C::D::E\"." |
gdb_test "ptype C" "type = namespace C::C" |
gdb_test "ptype E" "type = namespace C::D::E" |
|
gdb_test "ptype CClass" "type = (class C::CClass \{\r\n public:|struct C::CClass \{)\r\n int x;\r\n\}" |
gdb_test "ptype CClass::NestedClass" "type = (class C::CClass::NestedClass \{\r\n public:|struct C::CClass::NestedClass \{)\r\n int y;\r\n\}" |
gdb_test "ptype NestedClass" "No symbol \"NestedClass\" in current context." |
gdb_test "ptype ::C::CClass" "type = class C::CClass \{\r\n public:\r\n int x;\r\n\}" |
gdb_test "ptype ::C::CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n public:\r\n int y;\r\n\}" |
gdb_test "ptype ::C::NestedClass" "No symbol \"NestedClass\" in namespace \"C\"." |
gdb_test "ptype C::CClass" "No symbol \"CClass\" in namespace \"C::C\"." |
gdb_test "ptype C::CClass::NestedClass" "No type \"CClass\" within class or namespace \"C::C\"." |
gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\"." |
|
# Tests involving multiple files |
|
gdb_test "print cOtherFile" "\\$\[0-9\].* = 316" |
gdb_test "ptype OtherFileClass" "type = (class C::OtherFileClass \{\r\n public:|struct C::OtherFileClass \{)\r\n int z;\r\n.*\}" |
gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n.*\}" |
gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"." |
|
# Test class typedefs printing. |
set expect "type = class C::OtherFileClass \{\r\n.*\r\n *typedef short cOtherFileClassType;\r\n *typedef long cOtherFileClassType2;\r\n\}" |
if {[test_compiler_info {gcc-[0-3]-*}] |
|| [test_compiler_info {gcc-4-[0-4]-*}]} { |
# The type in class is missing in older GCCs. |
setup_xfail *-*-* |
} |
gdb_test "ptype OtherFileClass" $expect "ptype OtherFileClass typedefs" |
if {[test_compiler_info {gcc-[0-3]-*}] |
|| [test_compiler_info {gcc-4-[0-4]-*}]} { |
# The type in class is missing in older GCCs. |
setup_xfail *-*-* |
} |
gdb_test "ptype ::C::OtherFileClass" $expect "ptype ::C::OtherFileClass typedefs" |
|
# Some anonymous namespace tests. |
|
gdb_test "print cX" "\\$\[0-9\].* = 6" |
gdb_test "print 'F::cXf'" "\\$\[0-9\].* = 7" |
gdb_test "print F::cXf" "\\$\[0-9\].* = 7" |
gdb_test "print F::cXfX" "\\$\[0-9\].* = 8" |
gdb_test "print X" "\\$\[0-9\].* = 9" |
gdb_test "print 'G::Xg'" "\\$\[0-9\].* = 10" |
gdb_test "print G::Xg" "\\$\[0-9\].* = 10" |
gdb_test "print G::XgX" "\\$\[0-9\].* = 11" |
gdb_test "print cXOtherFile" "No symbol \"cXOtherFile\" in current context." |
gdb_test "print XOtherFile" "No symbol \"XOtherFile\" in current context." |
|
# Enum tests. |
gdb_test "print AAA::ALPHA" "\\$\[0-9\].* = AAA::ALPHA" |
|
# Regression tests for PR 9496. |
gdb_test "whatis ::C::CClass::NestedClass" "type = C::CClass::NestedClass" |
gdb_test "whatis ::C::CClass::NestedClass *" "type = C::CClass::NestedClass \\*" |
/cpcompletion.exp
0,0 → 1,103
# Copyright 2009, 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/>. |
|
# This file is part of the gdb testsuite. |
|
# A helper procedure to test location completions restricted by |
# class. |
proc test_class_complete {class expr name matches} { |
global gdb_prompt |
|
set matches [lsort $matches] |
set cmd "complete break ${class}::$expr" |
set seen {} |
gdb_test_multiple $cmd $name { |
"break ${class}::main" { fail "$name (saw global symbol)" } |
$cmd { exp_continue } |
-re "break ${class}::\[A-Za-z0-9_~\]+" { |
set str $expect_out(0,string) |
scan $str "break ${class}::%\[^(\]" method |
lappend seen $method |
exp_continue |
} |
-re "$gdb_prompt $" { |
set failed "" |
foreach got [lsort $seen] have $matches { |
if {![string equal $got $have]} { |
set failed $have |
break |
} |
} |
if {[string length $failed] != 0} { |
fail "$name ($failed not found)" |
} else { |
pass $name |
} |
} |
} |
} |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
if { [skip_cplus_tests] } { continue } |
|
set testfile pr9594 |
set binfile ${objdir}/${subdir}/${testfile} |
|
if {[gdb_compile "${srcdir}/${subdir}/${testfile}.cc" "${testfile}.o" object {c++ debug}] != ""} { |
untested cpcompletion.exp |
return -1 |
} |
|
if {[gdb_compile "${testfile}.o" ${binfile} executable {c++ debug}] != "" } { |
untested cpcompletion.exp |
return -1 |
} |
|
gdb_exit |
|
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
set bp_location [gdb_get_line_number "Set breakpoint here" ${testfile}.cc] |
|
if {![runto "${testfile}.cc:$bp_location"]} { |
perror "test suppressed" |
return |
} |
|
# This also tests inheritance -- completion should only see a single |
# "get_foo". |
gdb_test "complete p foo1.g" "p foo1\\.get_foo" |
|
# Test inheritance without overriding. |
gdb_test "complete p foo1.base" "p foo1\\.base_function_only" |
|
# Test non-completion of constructor names. |
gdb_test "complete p foo1.Fo" "p foo1\\.Foofoo" |
|
# Test completion with an anonymous struct. |
gdb_test "complete p a.g" "p a\\.get" |
|
# Test that completion is restricted by class name (all methods) |
test_class_complete Foo "" "complete class methods" \ |
[list Foo Foofoo get_foo set_foo ~Foo] |
|
test_class_complete Foo F "complete class methods beginning with F" \ |
[list Foo Foofoo] |
|
/nsrecurs.cc
0,0 → 1,57
namespace A |
{ |
int ax = 9; |
} |
|
namespace B |
{ |
using namespace A; |
} |
|
namespace C |
{ |
using namespace B; |
} |
|
using namespace C; |
|
//--------------- |
namespace D |
{ |
using namespace D; |
int dx = 99; |
} |
using namespace D; |
|
//--------------- |
namespace |
{ |
namespace |
{ |
int xx = 999; |
} |
} |
|
//--------------- |
namespace E |
{ |
int ex = 9999; |
} |
|
namespace F |
{ |
namespace FE = E; |
} |
|
namespace G |
{ |
namespace GF = F; |
} |
|
//---------------- |
int main () |
{ |
using namespace D; |
namespace GX = G; |
return ax + dx + xx + G::GF::FE::ex; |
} |
/nsdecl.cc
0,0 → 1,93
int a; |
int b; |
int c; |
int d; |
int e; |
int f; |
int g; |
int h; |
int i; |
int j; |
int k; |
int l; |
int m; |
int n; |
int o; |
int p; |
int q; |
int r; |
int s; |
int t; |
int u; |
int v; |
int w; |
int x; |
int y; |
int z; |
|
namespace A |
{ |
int xyz; |
|
using ::a; |
using ::b; |
using ::c; |
using ::d; |
using ::e; |
using ::f; |
using ::g; |
using ::h; |
using ::i; |
using ::j; |
using ::k; |
using ::l; |
using ::m; |
using ::n; |
using ::o; |
using ::p; |
using ::q; |
using ::r; |
using ::s; |
using ::t; |
using ::u; |
using ::v; |
using ::w; |
using ::x; |
using ::y; |
using ::z; |
|
} |
|
using A::a; |
using A::b; |
using A::c; |
using A::d; |
using A::e; |
using A::f; |
using A::g; |
using A::h; |
using A::i; |
using A::j; |
using A::k; |
using A::l; |
using A::m; |
using A::n; |
using A::o; |
using A::p; |
using A::q; |
using A::r; |
using A::s; |
using A::t; |
using A::u; |
using A::v; |
using A::w; |
using A::x; |
using A::y; |
using A::z; |
|
using namespace A; |
|
int main () |
{ |
return 0; |
} |
/pr-1210.exp
0,0 → 1,74
# Copyright 2003, 2007, 2008, 2009, 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/>. |
|
# Tests for PR gdb/1210. |
|
# This file is part of the gdb testsuite. |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
if { [skip_cplus_tests] } { continue } |
|
# |
# test running programs |
# |
|
set testfile "pr-1210" |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested pr-1210.exp |
return -1 |
} |
|
if [get_compiler_info ${binfile} "c++"] { |
return -1 |
} |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
if ![runto_main] then { |
perror "couldn't run to breakpoint" |
continue |
} |
|
gdb_test "next" ".*return 0;" "step past initialization" |
|
gdb_test_multiple "print *obj" "print *obj" { |
-re "Cannot access memory.*$gdb_prompt $" { |
fail "print *obj" |
} |
-re " = {<A> = {<No data fields>}, myB = {<A> = {<No data fields>}.*}}\r\n$gdb_prompt $" { |
pass "print *obj" |
} |
} |
|
gdb_test_multiple "print obj->myB" "print obj->myB" { |
-re "Cannot access memory.*$gdb_prompt $" { |
fail "print obj->myB" |
} |
-re " = {<A> = {<No data fields>}.*}\r\n$gdb_prompt $" { |
pass "print obj->myB" |
} |
} |
|
gdb_exit |
return 0 |
/m-data.exp
0,0 → 1,117
# Copyright 2002, 2007, 2008, 2009, 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/>. |
|
# Tests for member data |
# 2002-05-13 Benjamin Kosnik <bkoz@redhat.com> |
|
# This file is part of the gdb testsuite |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
if { [skip_cplus_tests] } { continue } |
|
# |
# test running programs |
# |
|
set testfile "m-data" |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested m-data.exp |
return -1 |
} |
|
if [get_compiler_info ${binfile} "c++"] { |
return -1 |
} |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
|
if ![runto_main] then { |
perror "couldn't run to breakpoint" |
continue |
} |
|
# First, run to after we've constructed all the gnu_obj_N's: |
|
gdb_breakpoint [gdb_get_line_number "first-constructs-done"] |
gdb_continue_to_breakpoint "end of first constructors" |
|
# One. |
|
# simple object, const bool |
gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool" |
|
# simple object, const int |
gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, const int" |
|
# simple object, long |
gdb_test "print test1.key2" "\\$\[0-9\]* = 4589" "simple object, long" |
|
# simple object, enum |
gdb_test "print test1.value" "\\$\[0-9\]* = egyptian" "simple object, enum" |
|
# Two. |
|
# derived template object, base const bool |
gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base const bool" |
|
# derived template object, base const int |
gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base const int" |
|
# derived template object, base long |
gdb_test "print test2.key2" "\\$\[0-9\]* = 7" "derived template object, base long" |
|
# derived template object, base enum |
gdb_test "print test2.value" "\\$\[0-9\]* = oriental" "derived template object, base enum" |
|
# derived template object, enum |
gdb_test "print test2.value_derived" "\\$\[0-9\]* = roman" "derived template object, derived enum" |
|
# Three. |
|
# template object, derived template data member's base const bool |
gdb_test "print test3.data.test" "\\$\[0-9\]* = true" "template object, const bool" |
|
# template object, derived template data member's base const int |
gdb_test "print test3.data.key1" "\\$\[0-9\]* = 5" "template object, const int" |
|
# template object, derived template data member's base long |
gdb_test "print test3.data.key2" "\\$\[0-9\]* = 7" "template object, long" |
|
# template object, derived template data member's base enum |
gdb_test "print test3.data.value" "\\$\[0-9\]* = oriental" "template object, base enum" |
|
# template object, derived template data member's enum |
gdb_test "print test3.data.value_derived" "\\$\[0-9]\* = etruscan" "template object, derived enum" |
|
# Now some tests for shadowing (see PR gdb/804): |
|
gdb_breakpoint "C::marker" |
gdb_continue_to_breakpoint "continue to shadow breakpoint" |
|
gdb_test "print shadow" "\\$\[0-9]\* = 1" "shadowing member" |
gdb_test "print ::shadow" "\\$\[0-9]\* = 0" "shadowed global variable" |
|
gdb_exit |
return 0 |
/koenig.cc
0,0 → 1,306
namespace A |
{ |
class C |
{ |
public: |
static const int x = 11; |
}; |
|
int |
first (C c) |
{ |
return 11; |
} |
|
int |
first (int a, C c) |
{ |
return 22; |
} |
|
int |
second (int a, int b, C cc, int c, int d) |
{ |
return 33; |
} |
|
} |
|
struct B |
{ |
A::C c; |
}; |
|
//------------ |
|
namespace E |
{ |
class O{}; |
int foo (O o){return 1; } |
int foo (O o, O o2){return 2; } |
int foo (O o, O o2, int i){return 3; } |
} |
|
namespace F |
{ |
class O{}; |
int foo ( O fo, ::E::O eo){ return 4;} |
int foo (int i, O fo, ::E::O eo){ return 5;} |
} |
|
namespace G |
{ |
class O{}; |
int foo (O go, ::F::O fo, ::E::O eo){ return 6; } |
} |
|
//------------ |
|
namespace H |
{ |
class O{}; |
int foo (O){ return 7;} |
} |
|
namespace I |
{ |
class O: public H::O {}; |
class X: H::O{}; |
} |
|
//------------ |
|
namespace J |
{ |
union U{}; |
struct S{}; |
enum E{}; |
|
class A{ |
public: |
class B{}; |
}; |
|
class C{}; |
|
int foo (U){ return 8;} |
int foo (S){ return 9;} |
int foo (E){ return 10;} |
int foo (A::B){ return 11;} |
int foo (A*){ return 12;} |
int foo (A**){ return 13;} |
int foo (C[]){ return 14;} |
|
} |
//------------ |
|
namespace K{ |
class O{}; |
|
int foo(O, int){ |
return 15; |
} |
|
int bar(O, int){ |
return 15; |
} |
} |
|
int foo(K::O, float){ |
return 16; |
} |
|
int bar(K::O, int){ |
return 16; |
} |
//------------ |
|
namespace L { |
namespace A{ |
namespace B{ |
class O {}; |
|
int foo (O){ |
return 17; |
} |
|
} |
} |
} |
|
//------------ |
|
namespace M { |
class A{ |
public: |
int foo(char) { |
return 18; |
} |
}; |
|
int foo(A,char){ |
return 19; |
} |
|
int foo(A *,char){ |
return 23; |
} |
|
int bar(char){ |
return 21; |
} |
|
namespace N { |
int foo(::M::A,int){ |
return 20; |
} |
|
int bar(int){ |
return 22; |
} |
} |
} |
//------------ |
|
namespace O { |
class A{}; |
|
int foo(A,int){ |
return 23; |
} |
|
} |
|
typedef O::A TOA; |
typedef TOA TTOA; |
|
//------------ |
|
static union { |
int a; |
char b; |
}p_union; |
|
//------------ |
|
namespace P { |
class Q{ |
public: |
int operator== (int) |
{ |
return 24; |
} |
|
int operator== (float) |
{ |
return 25; |
} |
|
int operator+ (float) |
{ |
return 26; |
} |
|
}; |
|
int operator!= (Q, int) |
{ |
return 27; |
} |
|
int operator!= (Q, double) |
{ |
return 28; |
} |
|
int operator+ (Q, int) |
{ |
return 29; |
} |
|
int operator++ (Q) |
{ |
return 30; |
} |
} |
|
//------------ |
|
int |
main () |
{ |
A::C c; |
B b; |
|
A::first (c); |
first (0, c); |
second (0, 0, c, 0, 0); |
A::first (b.c); |
|
E::O eo; |
F::O fo; |
G::O go; |
|
foo (eo); |
foo (eo, eo); |
foo (eo, eo, 1); |
foo (fo, eo); |
foo (1 ,fo, eo); |
foo (go, fo, eo); |
|
I::O io; |
I::X ix; |
|
foo (io); |
//foo (ix); |
|
J::U ju; |
J::S js; |
J::E je; |
J::A::B jab; |
J::A *jap; |
J::A **japp; |
J::C jca[3]; |
|
foo (ju); |
foo (js); |
foo (je); |
foo (jab); |
foo (jap); |
foo (japp); |
foo (jca); |
|
K::O ko; |
foo (ko, 1); |
foo (ko, 1.0f); |
//bar(ko,1); |
|
L::A::B::O labo; |
foo (labo); |
|
M::A ma; |
foo(ma,'a'); |
ma.foo('a'); |
M::N::foo(ma,'a'); |
|
M::bar('a'); |
M::N::bar('a'); |
|
TTOA ttoa; |
foo (ttoa, 'a'); |
|
P::Q q; |
q == 5; |
q == 5.0f; |
q != 5; |
q != 5.0f; |
q + 5; |
q + 5.0f; |
|
++q; |
|
return first (0, c) + foo (eo) + |
foo (eo, eo) + foo (eo, eo, 1) + |
foo (fo, eo) + foo (1 ,fo, eo) + |
foo (go, fo, eo); |
} |
/ref-types.cc
0,0 → 1,97
/* This test script is part of GDB, the GNU debugger. |
|
Copyright 1999, 2004, 2007, 2008, 2009, 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/>. |
*/ |
|
int main2(void); |
|
void marker1 (void) |
{ |
|
} |
|
|
|
int main(void) |
{ |
short s; |
short &rs = s; |
short *ps; |
short *&rps = ps; |
short as[4]; |
short (&ras)[4] = as; |
s = -1; |
ps = &s; |
as[0] = 0; |
as[1] = 1; |
as[2] = 2; |
as[3] = 3; |
|
#ifdef usestubs |
set_debug_traps(); |
breakpoint(); |
#endif |
marker1(); |
|
main2(); |
|
return 0; |
} |
|
int f() |
{ |
int f1; |
f1 = 1; |
return f1; |
} |
|
int main2(void) |
{ |
char C; |
unsigned char UC; |
short S; |
unsigned short US; |
int I; |
unsigned int UI; |
long L; |
unsigned long UL; |
float F; |
double D; |
char &rC = C; |
unsigned char &rUC = UC; |
short &rS = S; |
unsigned short &rUS = US; |
int &rI = I; |
unsigned int &rUI = UI; |
long &rL = L; |
unsigned long &rUL = UL; |
float &rF = F; |
double &rD = D; |
C = 'A'; |
UC = 21; |
S = -14; |
US = 7; |
I = 102; |
UI = 1002; |
L = -234; |
UL = 234; |
F = 1.25E10; |
D = -1.375E-123; |
I = f(); |
|
return 0; |
|
} |
/try_catch.cc
0,0 → 1,138
/* This test script is part of GDB, the GNU debugger. |
|
Copyright 2002, 2004, |
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 <exception> |
#include <stdexcept> |
#include <string> |
|
enum region { oriental, egyptian, greek, etruscan, roman }; |
|
// Test one. |
class gnu_obj_1 |
{ |
public: |
typedef region antiquities; |
const bool test; |
const int key1; |
long key2; |
|
antiquities value; |
|
gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {} |
}; |
|
// Test two. |
template<typename T> |
class gnu_obj_2: public virtual gnu_obj_1 |
{ |
public: |
antiquities value_derived; |
|
gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } |
}; |
|
// Test three. |
template<typename T> |
class gnu_obj_3 |
{ |
public: |
typedef region antiquities; |
gnu_obj_2<int> data; |
|
gnu_obj_3(antiquities b): data(etruscan) { } |
}; |
|
int main() |
{ |
bool test = true; |
const int i = 5; |
int j = i; |
gnu_obj_2<long> test2(roman); |
gnu_obj_3<long> test3(greek); |
|
// 1 |
try |
{ |
++j; |
throw gnu_obj_1(egyptian, 4589); // marker 1-throw |
} |
catch (gnu_obj_1& obj) |
{ |
++j; |
if (obj.value != egyptian) // marker 1-catch |
test &= false; |
if (obj.key2 != 4589) |
test &= false; |
} |
catch (...) |
{ |
j = 0; |
test &= false; |
} |
|
// 2 |
try |
{ |
++j; // marker 2-start |
try |
{ |
++j; // marker 2-next |
try |
{ |
++j; |
throw gnu_obj_1(egyptian, 4589); // marker 2-throw |
} |
catch (gnu_obj_1& obj) |
{ |
++j; |
if (obj.value != egyptian) // marker 2-catch |
test &= false; |
if (obj.key2 != 4589) |
test &= false; |
} |
} |
catch (gnu_obj_1& obj) |
{ |
++j; |
if (obj.value != egyptian) |
test &= false; |
if (obj.key2 != 4589) |
test &= false; |
} |
} |
catch (...) |
{ |
j = 0; |
test &= false; |
} |
|
// 3 use standard library |
using namespace std; |
try |
{ |
if (j < 100) |
throw invalid_argument("gdb.1"); // marker 3-throw |
} |
catch (exception& obj) |
{ |
if (obj.what() != "gdb.1") // marker 3-catch |
test &= false; |
} |
return 0; |
} |
/nsimport.exp
0,0 → 1,50
# Copyright 2008 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/>. |
|
# Test printing from multiple namespace |
# imported into the same scope. |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
|
set testfile nsimport |
set srcfile ${testfile}.cc |
set binfile ${objdir}/${subdir}/${testfile} |
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { |
untested "Couldn't compile test program" |
return -1 |
} |
|
# Get things started. |
|
gdb_exit |
gdb_start |
gdb_reinitialize_dir $srcdir/$subdir |
gdb_load ${binfile} |
|
############################################ |
# test printing of namespace imported within |
# the function. |
|
if ![runto_main] then { |
perror "couldn't run to breakpoint main" |
continue |
} |
|
gdb_test "print x" "\\$\[0-9\].* = 11" |
gdb_test "print xx" "\\$\[0-9\].* = 22" |
gdb_test "print xxx" "\\$\[0-9\].* = 33" |
/demangle.exp
0,0 → 1,1567
# Copyright (C) 1992, 1997, 1999, 2003, 2004, 2007, 2008, 2009, 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/>. |
|
# This file was written by Fred Fish. (fnf@cygnus.com) |
|
if $tracelevel then { |
strace $tracelevel |
} |
|
if { [skip_cplus_tests] } { continue } |
|
### The demangling style we last sent to GDB. |
set current_demangling_style none |
|
### Set GDB's current demangling style to STYLE. Subsequent calls to |
### test_demangle will include STYLE in the test name when reporting |
### passes and failures. |
proc set_demangling_style {style} { |
global gdb_prompt |
global current_demangling_style |
|
gdb_test_multiple "set demangle-style $style" \ |
"$style: set demangle-style" { |
-re "set demangle-style $style\[\r\n\]+$gdb_prompt $" { |
pass "$style: set demangle-style" |
} |
-re ".*$gdb_prompt $" { |
fail "$style: set demangle-style" |
error "set_demangling_style: set style" |
} |
timeout { |
fail "$style: set demangle-style (timeout)" |
error "set_demangling_style: set style" |
} |
} |
|
gdb_test_multiple "show demangle-style" \ |
"$style: check demangling style" { |
-re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" { |
pass "$style: check demangling style" |
} |
-re ".*$gdb_prompt $" { |
fail "$style: check demangling style" |
error "set_demangling_style: check style" |
} |
timeout { |
fail "$style: check demangling style (timeout)" |
error "set_demangling_style: check style" |
} |
} |
|
set current_demangling_style $style |
} |
|
|
### Utility function for test_demangling and test_demangling_exact. |
proc test_demangling_core {tester test result} { |
global current_demangling_style |
|
if {! [regexp {^([^ ]+): (.+)$} $test dummy style name]} { |
error "bad test name passed to test_demangling" |
} |
|
if {[string compare $style $current_demangling_style]} { |
set_demangling_style $style |
} |
|
$tester "maintenance demangle $name" $result $test |
} |
|
### Demangle an identifier, and check that the result matches a pattern. |
### |
### TEST should be of the form "STYLE: NAME", where STYLE is the name |
### of a demangling style (like "gnu" or "arm"), and NAME is a mangled |
### identifier to demangle. Pass when the result matches the regular |
### expression RESULT. Report passes and fails using TEST as the name |
### of the test. |
### |
### Why don't we just pass the STYLE and NAME as two separate |
### arguments, or let the style be a global variable? That would be |
### cleaner. However, doing it this way means that: |
### |
### 1) the name of the test, as recorded in the summary and log, |
### appears verbatim in the script, and |
### |
### 2) that test names are unique, even though we try to demangle the same |
### identifiers using several different mangling styles. |
### |
### This makes it a lot easier for people tracking down failures to |
### find the one they care about. |
|
proc test_demangling {test result} { |
test_demangling_core gdb_test $test $result |
} |
|
### Like test_demangling, above, except that RESULT is not a regexp, |
### but a string that must match exactly. |
|
proc test_demangling_exact {test result} { |
test_demangling_core gdb_test_exact $test $result |
} |
|
|
|
# |
# Test gnu style name demangling |
# |
|
proc test_gnu_style_demangling {} { |
global gdb_prompt |
|
test_demangling "gnu: Abort__FP6EditoriPCc" \ |
"Abort\[(\]+Editor \[*\]+, int, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: AddAlignment__9ivTSolverUiP12ivInteractorP7ivTGlue" "ivTSolver::AddAlignment(unsigned int, ivInteractor *, ivTGlue *)" |
test_demangling "gnu: Append__15NameChooserViewPCc" \ |
"NameChooserView::Append\[(\]+(const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: ArrowheadIntersects__9ArrowLineP9ArrowheadR6BoxObjP7Graphic" "ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *)" |
test_demangling_exact "gnu: AtEnd__13ivRubberGroup" "ivRubberGroup::AtEnd(void)" |
test_demangling_exact "gnu: BgFilter__9ivTSolverP12ivInteractor" "ivTSolver::BgFilter(ivInteractor *)" |
test_demangling "gnu: BitPatterntoa__FRC10BitPatternccc" \ |
"BitPatterntoa\[(\]+(const BitPattern|BitPattern const) &, char, char, char\[)\]+" |
test_demangling_exact "gnu: Check__6UArrayi" "UArray::Check(int)" |
test_demangling_exact "gnu: CoreConstDecls__8TextCodeR7ostream" "TextCode::CoreConstDecls(ostream &)" |
test_demangling_exact "gnu: Detach__8StateVarP12StateVarView" "StateVar::Detach(StateVarView *)" |
test_demangling_exact "gnu: Done__9ComponentG8Iterator" "Component::Done(Iterator)" |
test_demangling "gnu: DrawDestinationTransformedImage__FP7_XImageiiT0iiUlUiiiUiUlUlP4_XGCRC13ivTransformeriiii" \ |
"DrawDestinationTransformedImage\[(\]+_XImage \[*\]+, int, int, _XImage \[*\]+, int, int, unsigned long, unsigned int, int, int, unsigned int, unsigned long, unsigned long, _XGC \[*\]+, (const ivTransformer|ivTransformer const) &, int, int, int, int\[)\]+" |
|
test_demangling "gnu: Edit__12StringEditorPCcii" \ |
"StringEditor::Edit\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
test_demangling_exact "gnu: Effect__11RelateManipR7ivEvent" "RelateManip::Effect(ivEvent &)" |
test_demangling "gnu: FilterName__FPCc" \ |
"FilterName\[(\]+(const char|char const) \[*\]+\[)\]+" |
test_demangling "gnu: Filter__6PSTextPCci" \ |
"PSText::Filter\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
test_demangling "gnu: FindColor__7CatalogPCciii" \ |
"Catalog::FindColor\[(\]+(const char|char const) \[*\]+, int, int, int\[)\]+" |
test_demangling_exact "gnu: FindFixed__FRP4CNetP4CNet" "FindFixed(CNet *&, CNet *)" |
test_demangling "gnu: FindFont__7CatalogPCcN21" \ |
"Catalog::FindFont\[(\]+(const char|char const) \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: Fix48_abort__FR8twolongs" "Fix48_abort(twolongs &)" |
test_demangling_exact "gnu: GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2" "iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &)" |
test_demangling_exact "gnu: GetBgColor__C9ivPainter" "ivPainter::GetBgColor(void) const" |
|
test_demangling "gnu: Iisdouble__FPC6IntRep" \ |
"Iisdouble\[(\]+(const IntRep|IntRep const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: InsertBody__15H_PullrightMenuii" "H_PullrightMenu::InsertBody(int, int)" |
test_demangling_exact "gnu: InsertCharacter__9TextManipc" "TextManip::InsertCharacter(char)" |
|
test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *)" |
test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1iiUi" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *, int, int, unsigned int)" |
test_demangling "gnu: IsADirectory__FPCcR4stat" \ |
"IsADirectory\[(\]+(const char|char const) \[*\]+, stat &\[)\]+" |
test_demangling_exact "gnu: IsAGroup__FP11GraphicViewP11GraphicComp" "IsAGroup(GraphicView *, GraphicComp *)" |
test_demangling_exact "gnu: IsA__10ButtonCodeUl" "ButtonCode::IsA(unsigned long)" |
|
test_demangling_exact "gnu: ReadName__FR7istreamPc" "ReadName(istream &, char *)" |
test_demangling_exact "gnu: Redraw__13StringBrowseriiii" "StringBrowser::Redraw(int, int, int, int)" |
test_demangling_exact "gnu: Rotate__13ivTransformerf" "ivTransformer::Rotate(float)" |
test_demangling_exact "gnu: Rotated__C13ivTransformerf" "ivTransformer::Rotated(float) const" |
test_demangling_exact "gnu: Round__Ff" "Round(float)" |
|
test_demangling_exact "gnu: SetExport__16MemberSharedNameUi" "MemberSharedName::SetExport(unsigned int)" |
test_demangling_exact "gnu: Set__14ivControlState13ControlStatusUi" "ivControlState::Set(ControlStatus, unsigned int)" |
test_demangling_exact "gnu: Set__5DFacePcii" "DFace::Set(char *, int, int)" |
|
test_demangling_exact "gnu: VConvert__9ivTSolverP12ivInteractorRP8TElementT2" "ivTSolver::VConvert(ivInteractor *, TElement *&, TElement *&)" |
test_demangling_exact "gnu: VConvert__9ivTSolverP7ivTGlueRP8TElement" "ivTSolver::VConvert(ivTGlue *, TElement *&)" |
test_demangling_exact "gnu: VOrder__9ivTSolverUiRP12ivInteractorT2" "ivTSolver::VOrder(unsigned int, ivInteractor *&, ivInteractor *&)" |
test_demangling "gnu: Valid__7CatalogPCcRP4Tool" \ |
"Catalog::Valid\[(\]+(const char|char const) \[*\]+, Tool \[*\]+&\[)\]+" |
test_demangling_exact "gnu: _10PageButton\$__both" "PageButton::__both" |
test_demangling_exact "gnu: _3RNG\$singleMantissa" "RNG::singleMantissa" |
test_demangling_exact "gnu: _5IComp\$_release" "IComp::_release" |
test_demangling_exact "gnu: _\$_10BitmapComp" "BitmapComp::~BitmapComp(void)" |
|
test_demangling_exact "gnu: _\$_9__io_defs" "__io_defs::~__io_defs(void)" |
test_demangling_exact "gnu: _\$_Q23foo3bar" "foo::bar::~bar(void)" |
test_demangling_exact "gnu: _\$_Q33foo3bar4bell" "foo::bar::bell::~bell(void)" |
test_demangling_exact "gnu: __10ivTelltaleiP7ivGlyph" "ivTelltale::ivTelltale(int, ivGlyph *)" |
test_demangling_exact "gnu: __10ivViewportiP12ivInteractorUi" "ivViewport::ivViewport(int, ivInteractor *, unsigned int)" |
test_demangling_exact "gnu: __10ostrstream" "ostrstream::ostrstream(void)" |
test_demangling_exact "gnu: __10ostrstreamPcii" "ostrstream::ostrstream(char *, int, int)" |
test_demangling "gnu: __11BasicDialogiPCcP13ivButtonStateN22Ui" \ |
"BasicDialog::BasicDialog\[(\]+int, (const char|char const) \[*\]+, ivButtonState \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+, unsigned int\[)\]+" |
test_demangling_exact "gnu: __11BitmapTablei" "BitmapTable::BitmapTable(int)" |
test_demangling_exact "gnu: __12ViewportCodeP12ViewportComp" "ViewportCode::ViewportCode(ViewportComp *)" |
test_demangling "gnu: __12iv2_6_BorderiPCci" \ |
"iv2_6_Border::iv2_6_Border\[(\]+int, (const char|char const) \[*\]+, int\[)\]+" |
test_demangling_exact "gnu: __12iv2_6_Borderii" "iv2_6_Border::iv2_6_Border(int, int)" |
test_demangling "gnu: __12ivBackgroundiP7ivGlyphPC7ivColor" \ |
"ivBackground::ivBackground\[(\]+int, ivGlyph \[*\]+, (const ivColor|ivColor const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: __12ivBreak_Listl" "ivBreak_List::ivBreak_List(long)" |
test_demangling "gnu: __14TextInteractoriPCcUi" \ |
"TextInteractor::TextInteractor\[(\]+int, (const char|char const) \[*\]+, unsigned int\[)\]+" |
test_demangling_exact "gnu: __14iv2_6_MenuItemiP12ivInteractor" "iv2_6_MenuItem::iv2_6_MenuItem(int, ivInteractor *)" |
test_demangling "gnu: __14iv2_6_MenuItemiPCcP12ivInteractor" \ |
"iv2_6_MenuItem::iv2_6_MenuItem\[(\]+int, (const char|char const) \[*\]+, ivInteractor \[*\]+\[)\]+" |
|
test_demangling_exact "gnu: __20DisplayList_IteratorR11DisplayList" "DisplayList_Iterator::DisplayList_Iterator(DisplayList &)" |
test_demangling_exact "gnu: __3fooRT0" "foo::foo(foo &)" |
test_demangling_exact "gnu: __3fooiN31" "foo::foo(int, int, int, int)" |
test_demangling "gnu: __3fooiPCc" \ |
"foo::foo\[(\]+int, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: __3fooiRT0iT2iT2" "foo::foo(int, foo &, int, foo &, int, foo &)" |
test_demangling "gnu: __6GetOptiPPcPCc" \ |
"GetOpt::GetOpt\[(\]+int, char \[*\]+\[*\]+, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: __6KeyMapPT0" "KeyMap::KeyMap(KeyMap *)" |
test_demangling "gnu: __7ivWorldPCcRiPPcPC12ivOptionDescPC14ivPropertyData" \ |
"ivWorld::ivWorld\[(\]+(const char|char const) \[*\]+, int &, char \[*\]+\[*\]+, (const ivOptionDesc|ivOptionDesc const) \[*\]+, (const ivPropertyData|ivPropertyData const) \[*\]+\[)\]+" |
test_demangling "gnu: __7procbufPCci" \ |
"procbuf::procbuf\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
test_demangling_exact "gnu: __8ArrowCmdP6EditorUiUi" "ArrowCmd::ArrowCmd(Editor *, unsigned int, unsigned int)" |
|
test_demangling_exact "gnu: __9F_EllipseiiiiP7Graphic" "F_Ellipse::F_Ellipse(int, int, int, int, Graphic *)" |
test_demangling_exact "gnu: __9FrameDataP9FrameCompi" "FrameData::FrameData(FrameComp *, int)" |
test_demangling_exact "gnu: __9HVGraphicP9CanvasVarP7Graphic" "HVGraphic::HVGraphic(CanvasVar *, Graphic *)" |
test_demangling_exact "gnu: __Q23foo3bar" "foo::bar::bar(void)" |
test_demangling_exact "gnu: __Q33foo3bar4bell" "foo::bar::bell::bell(void)" |
test_demangling_exact "gnu: __aa__3fooRT0" "foo::operator&&(foo &)" |
test_demangling_exact "gnu: __aad__3fooRT0" "foo::operator&=(foo &)" |
test_demangling_exact "gnu: __ad__3fooRT0" "foo::operator&(foo &)" |
test_demangling_exact "gnu: __adv__3fooRT0" "foo::operator/=(foo &)" |
test_demangling_exact "gnu: __aer__3fooRT0" "foo::operator^=(foo &)" |
test_demangling_exact "gnu: __als__3fooRT0" "foo::operator<<=(foo &)" |
test_demangling_exact "gnu: __amd__3fooRT0" "foo::operator%=(foo &)" |
test_demangling_exact "gnu: __ami__3fooRT0" "foo::operator-=(foo &)" |
test_demangling_exact "gnu: __aml__3FixRT0" "Fix::operator*=(Fix &)" |
test_demangling_exact "gnu: __aml__5Fix16i" "Fix16::operator*=(int)" |
test_demangling_exact "gnu: __aml__5Fix32RT0" "Fix32::operator*=(Fix32 &)" |
test_demangling_exact "gnu: __aor__3fooRT0" "foo::operator|=(foo &)" |
test_demangling_exact "gnu: __apl__3fooRT0" "foo::operator+=(foo &)" |
test_demangling_exact "gnu: __ars__3fooRT0" "foo::operator>>=(foo &)" |
|
test_demangling_exact "gnu: __as__3fooRT0" "foo::operator=(foo &)" |
test_demangling_exact "gnu: __cl__3fooRT0" "foo::operator()(foo &)" |
test_demangling_exact "gnu: __cl__6Normal" "Normal::operator()(void)" |
test_demangling_exact "gnu: __cl__6Stringii" "String::operator()(int, int)" |
test_demangling_exact "gnu: __cm__3fooRT0" "foo::operator, (foo &)" |
test_demangling_exact "gnu: __co__3foo" "foo::operator~(void)" |
test_demangling_exact "gnu: __dl__3fooPv" "foo::operator delete(void *)" |
test_demangling_exact "gnu: __dv__3fooRT0" "foo::operator/(foo &)" |
test_demangling_exact "gnu: __eq__3fooRT0" "foo::operator==(foo &)" |
test_demangling_exact "gnu: __er__3fooRT0" "foo::operator^(foo &)" |
test_demangling_exact "gnu: __ge__3fooRT0" "foo::operator>=(foo &)" |
test_demangling_exact "gnu: __gt__3fooRT0" "foo::operator>(foo &)" |
test_demangling_exact "gnu: __le__3fooRT0" "foo::operator<=(foo &)" |
test_demangling_exact "gnu: __ls__3fooRT0" "foo::operator<<(foo &)" |
test_demangling_exact "gnu: __ls__FR7ostreamPFR3ios_R3ios" "operator<<(ostream &, ios &(*)(ios &))" |
test_demangling_exact "gnu: __ls__FR7ostreamR3Fix" "operator<<(ostream &, Fix &)" |
test_demangling_exact "gnu: __lt__3fooRT0" "foo::operator<(foo &)" |
test_demangling_exact "gnu: __md__3fooRT0" "foo::operator%(foo &)" |
test_demangling_exact "gnu: __mi__3fooRT0" "foo::operator-(foo &)" |
test_demangling_exact "gnu: __ml__3fooRT0" "foo::operator*(foo &)" |
test_demangling_exact "gnu: __mm__3fooi" "foo::operator--(int)" |
|
test_demangling_exact "gnu: __ne__3fooRT0" "foo::operator!=(foo &)" |
test_demangling "gnu: __ne__FRC7ComplexT0" \ |
"operator!=\[(\]+(const Complex|Complex const) &, (const Complex|Complex const) &\[)\]+" |
test_demangling "gnu: __ne__FRC7Complexd" \ |
"operator!=\[(\]+(const Complex|Complex const) &, double\[)\]+" |
test_demangling "gnu: __ne__FRC9SubStringRC6String" \ |
"operator!=\[(\]+(const SubString|SubString const) &, (const String|String const) &\[)\]+" |
test_demangling_exact "gnu: __nt__3foo" "foo::operator!(void)" |
test_demangling_exact "gnu: __nw__3fooi" "foo::operator new(int)" |
test_demangling_exact "gnu: __oo__3fooRT0" "foo::operator||(foo &)" |
test_demangling_exact "gnu: __opPc__3foo" "foo::operator char *(void)" |
test_demangling_exact "gnu: __opi__3foo" "foo::operator int(void)" |
test_demangling_exact "gnu: __or__3fooRT0" "foo::operator|(foo &)" |
test_demangling_exact "gnu: __pl__3fooRT0" "foo::operator+(foo &)" |
test_demangling_exact "gnu: __pp__3fooi" "foo::operator++(int)" |
test_demangling_exact "gnu: __rf__3foo" "foo::operator->(void)" |
test_demangling_exact "gnu: __rm__3fooRT0" "foo::operator->*(foo &)" |
test_demangling_exact "gnu: __rs__3fooRT0" "foo::operator>>(foo &)" |
test_demangling "gnu: __vc__3fooRT0" "foo::operator\\\[\\\]\\(foo &\\)" |
test_demangling "gnu: _gsub__6StringRC5RegexPCci" \ |
"String::_gsub\[(\]+(const Regex|Regex const) &, (const char|char const) \[*\]+, int\[)\]+" |
test_demangling_exact "gnu: _new_Fix__FUs" "_new_Fix(unsigned short)" |
|
# gcc 2.4.5 (and earlier) style virtual tables. We want to continue to |
# correctly demangle these even if newer compilers use a different form. |
test_demangling_exact "gnu: _vt.foo" "foo virtual table" |
test_demangling_exact "gnu: _vt.foo.bar" "foo::bar virtual table" |
test_demangling_exact "gnu: _vt\$foo" "foo virtual table" |
test_demangling_exact "gnu: _vt\$foo\$bar" "foo::bar virtual table" |
|
test_demangling_exact "gnu: append__7ivGlyphPT0" "ivGlyph::append(ivGlyph *)" |
test_demangling "gnu: arg__FRC7Complex" \ |
"arg\[(\]+(const Complex|Complex const) &\[)\]+" |
test_demangling_exact "gnu: clearok__FP7_win_sti" "clearok(_win_st *, int)" |
|
test_demangling_exact "gnu: complexfunc2__FPFPc_i" "complexfunc2(int (*)(char *))" |
test_demangling_exact "gnu: complexfunc3__FPFPFPl_s_i" "complexfunc3(int (*)(short (*)(long *)))" |
test_demangling_exact "gnu: complexfunc4__FPFPFPc_s_i" "complexfunc4(int (*)(short (*)(char *)))" |
test_demangling_exact "gnu: complexfunc5__FPFPc_PFl_i" "complexfunc5(int (*(*)(char *))(long))" |
test_demangling_exact "gnu: complexfunc6__FPFPi_PFl_i" "complexfunc6(int (*(*)(int *))(long))" |
test_demangling_exact "gnu: complexfunc7__FPFPFPc_i_PFl_i" "complexfunc7(int (*(*)(int (*)(char *)))(long))" |
test_demangling "gnu: contains__C9BitStringRC10BitPattern" \ |
"BitString::contains\[(\]+(const BitPattern|BitPattern const) &\[)\]+ const" |
test_demangling "gnu: contains__C9BitStringRC12BitSubStringi" \ |
"BitString::contains\[(\]+(const BitSubString|BitSubString const) &, int\[)\]+ const" |
test_demangling "gnu: contains__C9BitStringRT0" \ |
"BitString::contains\[(\]+(const BitString|BitString const) &\[)\]+ const" |
test_demangling "gnu: div__FPC6IntRepT0P6IntRep" \ |
"div\[(\]+(const IntRep|IntRep const) \[*\]+, (const IntRep|IntRep const) \[*\]+, IntRep \[*\]+\[)\]+" |
test_demangling "gnu: div__FPC6IntReplP6IntRep" \ |
"div\[(\]+(const IntRep|IntRep const) \[*\]+, long, IntRep \[*\]+\[)\]+" |
test_demangling "gnu: div__FRC8RationalT0R8Rational" \ |
"div\[(\]+(const Rational|Rational const) &, (const Rational|Rational const) &, Rational &\[)\]+" |
test_demangling "gnu: divide__FRC7IntegerT0R7IntegerT2" \ |
"divide\[(\]+(const Integer|Integer const) &, (const Integer|Integer const) &, Integer &, Integer &\[)\]+" |
test_demangling "gnu: divide__FRC7IntegerlR7IntegerRl" \ |
"divide\[(\]+(const Integer|Integer const) &, long, Integer &, long &\[)\]+" |
test_demangling "gnu: enable__14DocumentViewerPCcUi" \ |
"DocumentViewer::enable\[(\]+(const char|char const) \[*\]+, unsigned int\[)\]+" |
|
test_demangling_exact "gnu: foo__FiN30" "foo(int, int, int, int)" |
test_demangling_exact "gnu: foo__FiR3fooiT1iT1" "foo(int, foo &, int, foo &, int, foo &)" |
test_demangling_exact "gnu: foo___3barl" "bar::foo_(long)" |
test_demangling_exact "gnu: insert__15ivClippingStacklRP8_XRegion" "ivClippingStack::insert(long, _XRegion *&)" |
test_demangling_exact "gnu: insert__16ChooserInfo_ListlR11ChooserInfo" "ChooserInfo_List::insert(long, ChooserInfo &)" |
test_demangling_exact "gnu: insert__17FontFamilyRepListlRP15ivFontFamilyRep" "FontFamilyRepList::insert(long, ivFontFamilyRep *&)" |
test_demangling_exact "gnu: leaveok__FP7_win_stc" "leaveok(_win_st *, char)" |
test_demangling_exact "gnu: left_mover__C7ivMFKitP12ivAdjustableP7ivStyle" "ivMFKit::left_mover(ivAdjustable *, ivStyle *) const" |
test_demangling "gnu: matches__C9BitStringRC10BitPatterni" \ |
"BitString::matches\[(\]+(const BitPattern|BitPattern const) &, int\[)\]+ const" |
test_demangling "gnu: matches__C9SubStringRC5Regex" \ |
"SubString::matches\[(\]+(const Regex|Regex const) &\[)\]+ const" |
|
test_demangling_exact "gnu: overload1arg__FSc" "overload1arg(signed char)" |
test_demangling_exact "gnu: overload1arg__FUc" "overload1arg(unsigned char)" |
test_demangling_exact "gnu: overload1arg__FUi" "overload1arg(unsigned int)" |
test_demangling_exact "gnu: overload1arg__FUl" "overload1arg(unsigned long)" |
test_demangling_exact "gnu: overload1arg__FUs" "overload1arg(unsigned short)" |
test_demangling_exact "gnu: overload1arg__Fc" "overload1arg(char)" |
test_demangling_exact "gnu: overload1arg__Fd" "overload1arg(double)" |
test_demangling_exact "gnu: overload1arg__Ff" "overload1arg(float)" |
test_demangling_exact "gnu: overload1arg__Fi" "overload1arg(int)" |
test_demangling_exact "gnu: overload1arg__Fl" "overload1arg(long)" |
test_demangling_exact "gnu: overload1arg__Fs" "overload1arg(short)" |
test_demangling_exact "gnu: overload1arg__Fv" "overload1arg(void)" |
test_demangling_exact "gnu: overloadargs__Fi" "overloadargs(int)" |
test_demangling_exact "gnu: overloadargs__Fii" "overloadargs(int, int)" |
test_demangling_exact "gnu: overloadargs__Fiii" "overloadargs(int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiii" "overloadargs(int, int, int, int)" |
|
test_demangling_exact "gnu: overloadargs__Fiiiii" "overloadargs(int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiii" "overloadargs(int, int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiiii" "overloadargs(int, int, int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int, int)" |
test_demangling_exact "gnu: overloadargs__Fiiiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int, int, int)" |
test_demangling "gnu: pick__13ivCompositionP8ivCanvasRC12ivAllocationiR5ivHit" \ |
"ivComposition::pick\[(\]+ivCanvas \[*\]+, (const ivAllocation|ivAllocation const) &, int, ivHit &\[)\]+" |
test_demangling "gnu: pointer__C11ivHScrollerRC7ivEventRC12ivAllocation" \ |
"ivHScroller::pointer\[(\]+(const ivEvent|ivEvent const) &, (const ivAllocation|ivAllocation const) &\[)\]+ const" |
test_demangling_exact "gnu: poke__8ivRasterUlUlffff" "ivRaster::poke(unsigned long, unsigned long, float, float, float, float)" |
test_demangling_exact "gnu: polar__Fdd" "polar(double, double)" |
test_demangling "gnu: read__10osStdInputRPCc" \ |
"osStdInput::read\[(\]+(const char|char const) \[*\]+&\[)\]+" |
|
test_demangling_exact "gnu: scale__13ivTransformerff" "ivTransformer::scale(float, float)" |
test_demangling "gnu: scanw__12CursesWindowPCce" \ |
"CursesWindow::scanw\[(\]+(const char|char const) \[*\]+,...\[)\]+" |
test_demangling "gnu: scmp__FPCcT0" \ |
"scmp\[(\]+(const char|char const) \[*\]+, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "gnu: sgetn__7filebufPci" "filebuf::sgetn(char *, int)" |
test_demangling_exact "gnu: shift__FP5_FrepiT0" "shift(_Frep *, int, _Frep *)" |
test_demangling_exact "gnu: test__C6BitSeti" "BitSet::test(int) const" |
test_demangling_exact "gnu: test__C6BitSetii" "BitSet::test(int, int) const" |
test_demangling "gnu: testbit__FRC7Integerl" \ |
"testbit\[(\]+(const Integer|Integer const) &, long\[)\]+" |
test_demangling_exact "gnu: text_source__8Documentl" "Document::text_source(long)" |
test_demangling_exact "gnu: variance__6Erlangd" "Erlang::variance(double)" |
test_demangling "gnu: vform__8iostreamPCcPc" \ |
"iostream::vform\[(\]+(const char|char const) \[*\]+, char \[*\]+\[)\]+" |
test_demangling_exact "gnu: view__14DocumentViewerP8ItemViewP11TabularItem" "DocumentViewer::view(ItemView *, TabularItem *)" |
test_demangling_exact "gnu: xy_extents__11ivExtensionffff" "ivExtension::xy_extents(float, float, float, float)" |
test_demangling_exact "gnu: zero__8osMemoryPvUi" "osMemory::zero(void *, unsigned int)" |
test_demangling_exact "gnu: _2T4\$N" "T4::N" |
test_demangling_exact "gnu: _Q22T42t1\$N" "T4::t1::N" |
test_demangling_exact "gnu: get__2T1" "T1::get(void)" |
test_demangling_exact "gnu: get__Q22T11a" "T1::a::get(void)" |
test_demangling_exact "gnu: get__Q32T11a1b" "T1::a::b::get(void)" |
test_demangling_exact "gnu: get__Q42T11a1b1c" "T1::a::b::c::get(void)" |
test_demangling_exact "gnu: get__Q52T11a1b1c1d" "T1::a::b::c::d::get(void)" |
test_demangling_exact "gnu: put__2T1i" "T1::put(int)" |
test_demangling_exact "gnu: put__Q22T11ai" "T1::a::put(int)" |
test_demangling_exact "gnu: put__Q32T11a1bi" "T1::a::b::put(int)" |
test_demangling_exact "gnu: put__Q42T11a1b1ci" "T1::a::b::c::put(int)" |
test_demangling_exact "gnu: put__Q52T11a1b1c1di" "T1::a::b::c::d::put(int)" |
|
test_demangling_exact "gnu: bar__3fooPv" "foo::bar(void *)" |
test_demangling "gnu: bar__3fooPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+" |
test_demangling_exact "gnu: bar__C3fooPv" "foo::bar(void *) const" |
test_demangling "gnu: bar__C3fooPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const" |
test_demangling_exact "gnu: __eq__3fooRT0" "foo::operator==(foo &)" |
test_demangling "gnu: __eq__3fooRC3foo" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+" |
test_demangling_exact "gnu: __eq__C3fooR3foo" "foo::operator==(foo &) const" |
test_demangling "gnu: __eq__C3fooRT0" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const" |
|
test_demangling_exact "gnu: elem__t6vector1Zdi" "vector<double>::elem(int)" |
test_demangling_exact "gnu: elem__t6vector1Zii" "vector<int>::elem(int)" |
test_demangling_exact "gnu: __t6vector1Zdi" "vector<double>::vector(int)" |
test_demangling_exact "gnu: __t6vector1Zii" "vector<int>::vector(int)" |
test_demangling_exact "gnu: _\$_t6vector1Zdi" "vector<double>::~vector(int)" |
test_demangling_exact "gnu: _\$_t6vector1Zii" "vector<int>::~vector(int)" |
|
test_demangling_exact "gnu: __nw__t2T11ZcUi" "T1<char>::operator new(unsigned int)" |
test_demangling_exact "gnu: __nw__t2T11Z1tUi" "T1<t>::operator new(unsigned int)" |
test_demangling_exact "gnu: __dl__t2T11ZcPv" "T1<char>::operator delete(void *)" |
test_demangling_exact "gnu: __dl__t2T11Z1tPv" "T1<t>::operator delete(void *)" |
test_demangling_exact "gnu: __t2T11Zci" "T1<char>::T1(int)" |
test_demangling_exact "gnu: __t2T11Zc" "T1<char>::T1(void)" |
test_demangling_exact "gnu: __t2T11Z1ti" "T1<t>::T1(int)" |
test_demangling_exact "gnu: __t2T11Z1t" "T1<t>::T1(void)" |
|
test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3Pix" \ |
"List<VHDLEntity>::Pix::Pix(void)" |
|
test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3PixPQ2t4List1Z10VHDLEntity7element" \ |
"List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::element *)" |
|
test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3PixRCQ2t4List1Z10VHDLEntity3Pix" \ |
"List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::Pix const &)" |
|
test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity7elementRC10VHDLEntityPT0" \ |
"List<VHDLEntity>::element::element(VHDLEntity const &, List<VHDLEntity>::element *)" |
|
test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity7elementRCQ2t4List1Z10VHDLEntity7element" \ |
"List<VHDLEntity>::element::element(List<VHDLEntity>::element const &)" |
|
test_demangling_exact "gnu: __cl__C11VHDLLibraryGt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \ |
"VHDLLibrary::operator()(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >) const" |
|
test_demangling_exact "gnu: __cl__Ct4List1Z10VHDLEntityRCQ2t4List1Z10VHDLEntity3Pix" \ |
"List<VHDLEntity>::operator()(List<VHDLEntity>::Pix const &) const" |
|
test_demangling_exact "gnu: __ne__FPvRCQ2t4List1Z10VHDLEntity3Pix" \ |
"operator!=(void *, List<VHDLEntity>::Pix const &)" |
|
test_demangling_exact "gnu: __ne__FPvRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \ |
"operator!=(void *, PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &)" |
|
test_demangling_exact "gnu: __t4List1Z10VHDLEntityRCt4List1Z10VHDLEntity" \ |
"List<VHDLEntity>::List(List<VHDLEntity> const &)" |
|
test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \ |
"PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(void)" |
|
test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityP14VHDLLibraryRepGQ2t4List1Z10VHDLEntity3Pix" \ |
"PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(VHDLLibraryRep *, List<VHDLEntity>::Pix)" |
|
test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \ |
"PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &)" |
|
test_demangling_exact "gnu: nextE__C11VHDLLibraryRt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \ |
"VHDLLibrary::nextE(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > &) const" |
|
test_demangling_exact "gnu: next__Ct4List1Z10VHDLEntityRQ2t4List1Z10VHDLEntity3Pix" \ |
"List<VHDLEntity>::next(List<VHDLEntity>::Pix &) const" |
|
test_demangling_exact "gnu: _GLOBAL_\$D\$set" "global destructors keyed to set" |
|
test_demangling_exact "gnu: _GLOBAL_\$I\$set" "global constructors keyed to set" |
|
test_demangling_exact "gnu: __as__t5ListS1ZUiRCt5ListS1ZUi" \ |
"ListS<unsigned int>::operator=(ListS<unsigned int> const &)" |
|
test_demangling_exact "gnu: __cl__Ct5ListS1ZUiRCQ2t5ListS1ZUi3Vix" \ |
"ListS<unsigned int>::operator()(ListS<unsigned int>::Vix const &) const" |
|
test_demangling_exact "gnu: __cl__Ct5SetLS1ZUiRCQ2t5SetLS1ZUi3Vix" \ |
"SetLS<unsigned int>::operator()(SetLS<unsigned int>::Vix const &) const" |
|
test_demangling_exact "gnu: __t10ListS_link1ZUiRCUiPT0" \ |
"ListS_link<unsigned int>::ListS_link(unsigned int const &, ListS_link<unsigned int> *)" |
|
test_demangling_exact "gnu: __t10ListS_link1ZUiRCt10ListS_link1ZUi" \ |
"ListS_link<unsigned int>::ListS_link(ListS_link<unsigned int> const &)" |
|
test_demangling_exact "gnu: __t5ListS1ZUiRCt5ListS1ZUi" \ |
"ListS<unsigned int>::ListS(ListS<unsigned int> const &)" |
|
test_demangling_exact "gnu: next__Ct5ListS1ZUiRQ2t5ListS1ZUi3Vix" \ |
"ListS<unsigned int>::next(ListS<unsigned int>::Vix &) const" |
|
test_demangling_exact "gnu: __ne__FPvRCQ2t5SetLS1ZUi3Vix" \ |
"operator!=(void *, SetLS<unsigned int>::Vix const &)" |
test_demangling_exact "gnu: __t8ListElem1Z5LabelRt4List1Z5Label" \ |
"ListElem<Label>::ListElem(List<Label> &)" |
test_demangling_exact "gnu: __t8BDDHookV1ZPcRCPc" \ |
"BDDHookV<char *>::BDDHookV(char *const &)" |
|
test_demangling_exact "gnu: _vt\$t8BDDHookV1ZPc" "BDDHookV<char *> virtual table" |
|
test_demangling_exact "gnu: __ne__FPvRCQ211BDDFunction4VixB" \ |
"operator!=(void *, BDDFunction::VixB const &)" |
test_demangling_exact "gnu: __eq__FPvRCQ211BDDFunction4VixB" \ |
"operator==(void *, BDDFunction::VixB const &)" |
|
test_demangling_exact "gnu: relativeId__CQ36T_phi210T_preserve8FPC_nextRCQ26T_phi210T_preserveRC10Parameters" \ |
"T_phi2::T_preserve::FPC_next::relativeId(T_phi2::T_preserve const &, Parameters const &) const" |
|
test_demangling_exact "gnu: _Utf390_1__1_9223372036854775807__9223372036854775" \ |
"Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\"" |
test_demangling_exact "gnu: foo__I40" "foo(int64_t)" |
test_demangling_exact "gnu: foo__I_200_" "foo(int512_t)" |
test_demangling_exact "gnu: foo__I_200" "Can't demangle \"foo__I_200\"" |
|
## Buffer overrun. Should make GDB crash. Woo hoo! |
test_demangling_exact "gnu: foo__I_4000000000000000000000000000000000000000000000000000000000000000000000000" "Can't demangle \"foo__I_4000000000000000000000000000000000000000000000000000000000000000000000000\"" |
|
## 1999-04-19: "Fix from Dale Hawkins". Shouldn't segfault. |
# Accept even a dubious demangling; the string is ambiguous. |
|
gdb_test_multiple "maintenance demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" { |
-re "virtual function thunk \\(delta:-64\\) for CosNaming::_proxy_NamingContext::_0RL__list\\(unsigned long, _CORBA_Unbounded_Sequence<CosNaming::Binding> \\*\\&, CosNaming::BindingIterator \\*\\&\\)\r\n$gdb_prompt $" { |
pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" |
} |
-re ".*Can't demangle \"__thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator\"\r\n$gdb_prompt $" { |
pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" |
} |
} |
} |
|
# |
# Test lucid style name demangling |
# |
|
proc test_lucid_style_demangling {} { |
test_demangling_exact "lucid: WS__FR7istream" "WS(istream &)" |
test_demangling_exact "lucid: __aa__3fooFR3foo" "foo::operator&&(foo &)" |
test_demangling_exact "lucid: __aad__3fooFR3foo" "foo::operator&=(foo &)" |
test_demangling_exact "lucid: __ad__3fooFR3foo" "foo::operator&(foo &)" |
test_demangling_exact "lucid: __adv__3fooFR3foo" "foo::operator/=(foo &)" |
test_demangling_exact "lucid: __adv__7complexF7complex" "complex::operator/=(complex)" |
test_demangling_exact "lucid: __aer__3fooFR3foo" "foo::operator^=(foo &)" |
test_demangling_exact "lucid: __als__3fooFR3foo" "foo::operator<<=(foo &)" |
test_demangling_exact "lucid: __amd__3fooFR3foo" "foo::operator%=(foo &)" |
test_demangling_exact "lucid: __ami__3fooFR3foo" "foo::operator-=(foo &)" |
test_demangling_exact "lucid: __amu__3fooFR3foo" "foo::operator*=(foo &)" |
test_demangling_exact "lucid: __amu__7complexF7complex" "complex::operator*=(complex)" |
test_demangling_exact "lucid: __aor__3fooFR3foo" "foo::operator|=(foo &)" |
test_demangling_exact "lucid: __apl__3fooFR3foo" "foo::operator+=(foo &)" |
test_demangling_exact "lucid: __ars__3fooFR3foo" "foo::operator>>=(foo &)" |
test_demangling_exact "lucid: __as__18istream_withassignFP9streambuf" "istream_withassign::operator=(streambuf *)" |
test_demangling_exact "lucid: __as__18istream_withassignFR7istream" "istream_withassign::operator=(istream &)" |
test_demangling_exact "lucid: __as__3fooFR3foo" "foo::operator=(foo &)" |
test_demangling_exact "lucid: __as__3iosFR3ios" "ios::operator=(ios &)" |
test_demangling_exact "lucid: __cl__3fooFR3foo" "foo::operator()(foo &)" |
test_demangling_exact "lucid: __cm__3fooFR3foo" "foo::operator, (foo &)" |
|
test_demangling_exact "lucid: __co__3fooFv" "foo::operator~(void)" |
test_demangling_exact "lucid: __ct__10istrstreamFPc" "istrstream::istrstream(char *)" |
test_demangling_exact "lucid: __ct__10istrstreamFPci" "istrstream::istrstream(char *, int)" |
test_demangling_exact "lucid: __ct__10ostrstreamFPciT2" "ostrstream::ostrstream(char *, int, int)" |
test_demangling_exact "lucid: __ct__10ostrstreamFv" "ostrstream::ostrstream(void)" |
test_demangling_exact "lucid: __ct__10smanip_intFPFR3iosi_R3iosi" "smanip_int::smanip_int(ios &(*)(ios &, int), int)" |
test_demangling "lucid: __ct__11c_exceptionFPcRC7complexT2" "c_exception::c_exception\[(\]+char \[*\]+, (const complex|complex const) &, (const complex|complex const) &\[)\]+" |
test_demangling "lucid: __ct__11fstreambaseFPCciT2" "fstreambase::fstreambase\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
test_demangling_exact "lucid: __ct__11fstreambaseFi" "fstreambase::fstreambase(int)" |
test_demangling_exact "lucid: __ct__11fstreambaseFiPcT1" "fstreambase::fstreambase(int, char *, int)" |
test_demangling_exact "lucid: __ct__11fstreambaseFv" "fstreambase::fstreambase(void)" |
test_demangling_exact "lucid: __ct__11smanip_longFPFR3iosl_R3iosl" "smanip_long::smanip_long(ios &(*)(ios &, long), long)" |
test_demangling_exact "lucid: __ct__11stdiostreamFP4FILE" "stdiostream::stdiostream(FILE *)" |
test_demangling_exact "lucid: __ct__12strstreambufFPFl_PvPFPv_v" "strstreambuf::strstreambuf(void *(*)(long), void (*)(void *))" |
test_demangling_exact "lucid: __ct__12strstreambufFPUciT1" "strstreambuf::strstreambuf(unsigned char *, int, unsigned char *)" |
test_demangling_exact "lucid: __ct__12strstreambufFPciT1" "strstreambuf::strstreambuf(char *, int, char *)" |
test_demangling_exact "lucid: __ct__12strstreambufFi" "strstreambuf::strstreambuf(int)" |
test_demangling_exact "lucid: __ct__12strstreambufFv" "strstreambuf::strstreambuf(void)" |
test_demangling_exact "lucid: __ct__13strstreambaseFPciT1" "strstreambase::strstreambase(char *, int, char *)" |
test_demangling_exact "lucid: __ct__3fooFR3foo" "foo::foo(foo &)" |
|
test_demangling_exact "lucid: __ct__3fooFi" "foo::foo(int)" |
test_demangling_exact "lucid: __ct__3fooFiN31" "foo::foo(int, int, int, int)" |
test_demangling "lucid: __ct__3fooFiPCc" \ |
"foo::foo\[(\]+int, (const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "lucid: __ct__3fooFiR3fooT1T2T1T2" "foo::foo(int, foo &, int, foo &, int, foo &)" |
test_demangling_exact "lucid: __ct__3iosFP9streambuf" "ios::ios(streambuf *)" |
test_demangling_exact "lucid: __ct__7filebufFiPcT1" "filebuf::filebuf(int, char *, int)" |
test_demangling "lucid: __ct__7fstreamFPCciT2" \ |
"fstream::fstream\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
test_demangling_exact "lucid: __ct__7fstreamFiPcT1" "fstream::fstream(int, char *, int)" |
test_demangling_exact "lucid: __ct__7istreamFP9streambuf" "istream::istream(streambuf *)" |
test_demangling_exact "lucid: __ct__7istreamFP9streambufiP7ostream" "istream::istream(streambuf *, int, ostream *)" |
test_demangling_exact "lucid: __ct__7istreamFiPcT1" "istream::istream(int, char *, int)" |
test_demangling_exact "lucid: __ct__7istreamFiT1P7ostream" "istream::istream(int, int, ostream *)" |
test_demangling_exact "lucid: __ct__7ostreamFP9streambuf" "ostream::ostream(streambuf *)" |
test_demangling_exact "lucid: __ct__7ostreamFiPc" "ostream::ostream(int, char *)" |
test_demangling "lucid: __ct__8ifstreamFPCciT2" \ |
"ifstream::ifstream\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
test_demangling_exact "lucid: __ct__8ifstreamFiPcT1" "ifstream::ifstream(int, char *, int)" |
|
test_demangling_exact "lucid: __ct__Q23foo3barFv" "foo::bar::bar(void)" |
test_demangling_exact "lucid: __ct__Q33foo3bar4bellFv" "foo::bar::bell::bell(void)" |
test_demangling_exact "lucid: __dl__3fooSFPv" "foo::operator delete(void *) static" |
test_demangling_exact "lucid: __dl__FPv" "operator delete(void *)" |
test_demangling_exact "lucid: __dt__10istrstreamFv" "istrstream::~istrstream(void)" |
|
test_demangling_exact "lucid: __dt__Q23foo3barFv" "foo::bar::~bar(void)" |
test_demangling_exact "lucid: __dt__Q33foo3bar4bellFv" "foo::bar::bell::~bell(void)" |
test_demangling_exact "lucid: __dv__3fooFR3foo" "foo::operator/(foo &)" |
test_demangling_exact "lucid: __dv__F7complexT1" "operator/(complex, complex)" |
test_demangling_exact "lucid: __eq__3fooFR3foo" "foo::operator==(foo &)" |
test_demangling_exact "lucid: __er__3fooFR3foo" "foo::operator^(foo &)" |
test_demangling_exact "lucid: __ge__3fooFR3foo" "foo::operator>=(foo &)" |
test_demangling_exact "lucid: __gt__3fooFR3foo" "foo::operator>(foo &)" |
test_demangling_exact "lucid: __le__3fooFR3foo" "foo::operator<=(foo &)" |
test_demangling_exact "lucid: __ls__3fooFR3foo" "foo::operator<<(foo &)" |
test_demangling_exact "lucid: __ls__7ostreamFP9streambuf" "ostream::operator<<(streambuf *)" |
|
test_demangling "lucid: __ls__7ostreamFPCc" \ |
"ostream::operator<<\[(\]+(const char|char const) \[*\]+\[)\]+" |
test_demangling_exact "lucid: __ls__7ostreamFPFR3ios_R3ios" "ostream::operator<<(ios &(*)(ios &))" |
test_demangling_exact "lucid: __ls__7ostreamFPv" "ostream::operator<<(void *)" |
test_demangling_exact "lucid: __ls__7ostreamFUi" "ostream::operator<<(unsigned int)" |
test_demangling_exact "lucid: __ls__7ostreamFUl" "ostream::operator<<(unsigned long)" |
test_demangling_exact "lucid: __ls__7ostreamFd" "ostream::operator<<(double)" |
test_demangling_exact "lucid: __ls__7ostreamFf" "ostream::operator<<(float)" |
test_demangling_exact "lucid: __ls__7ostreamFi" "ostream::operator<<(int)" |
test_demangling_exact "lucid: __ls__7ostreamFl" "ostream::operator<<(long)" |
test_demangling_exact "lucid: __ls__FR7ostream7complex" "operator<<(ostream &, complex)" |
test_demangling_exact "lucid: __lt__3fooFR3foo" "foo::operator<(foo &)" |
test_demangling_exact "lucid: __md__3fooFR3foo" "foo::operator%(foo &)" |
test_demangling_exact "lucid: __mi__3fooFR3foo" "foo::operator-(foo &)" |
test_demangling_exact "lucid: __ml__3fooFR3foo" "foo::operator*(foo &)" |
test_demangling_exact "lucid: __ml__F7complexT1" "operator*(complex, complex)" |
test_demangling_exact "lucid: __mm__3fooFi" "foo::operator--(int)" |
test_demangling_exact "lucid: __ne__3fooFR3foo" "foo::operator!=(foo &)" |
test_demangling_exact "lucid: __nt__3fooFv" "foo::operator!(void)" |
test_demangling_exact "lucid: __nw__3fooSFi" "foo::operator new(int) static" |
test_demangling_exact "lucid: __nw__FUi" "operator new(unsigned int)" |
test_demangling_exact "lucid: __nw__FUiPv" "operator new(unsigned int, void *)" |
test_demangling_exact "lucid: __oo__3fooFR3foo" "foo::operator||(foo &)" |
test_demangling_exact "lucid: __opPc__3fooFv" "foo::operator char *(void)" |
test_demangling_exact "lucid: __opi__3fooFv" "foo::operator int(void)" |
test_demangling_exact "lucid: __or__3fooFR3foo" "foo::operator|(foo &)" |
|
test_demangling_exact "lucid: __pl__3fooFR3foo" "foo::operator+(foo &)" |
test_demangling_exact "lucid: __pp__3fooFi" "foo::operator++(int)" |
test_demangling_exact "lucid: __pt__3fooFv" "foo::operator->(void)" |
test_demangling_exact "lucid: __rm__3fooFR3foo" "foo::operator->*(foo &)" |
test_demangling_exact "lucid: __rs__3fooFR3foo" "foo::operator>>(foo &)" |
test_demangling_exact "lucid: __rs__7istreamFP9streambuf" "istream::operator>>(streambuf *)" |
test_demangling_exact "lucid: __rs__7istreamFPFR3ios_R3ios" "istream::operator>>(ios &(*)(ios &))" |
test_demangling_exact "lucid: __rs__7istreamFPFR7istream_R7istream" "istream::operator>>(istream &(*)(istream &))" |
test_demangling_exact "lucid: __rs__7istreamFPUc" "istream::operator>>(unsigned char *)" |
test_demangling_exact "lucid: __rs__7istreamFPc" "istream::operator>>(char *)" |
test_demangling_exact "lucid: __rs__7istreamFRUi" "istream::operator>>(unsigned int &)" |
test_demangling_exact "lucid: __rs__7istreamFRUl" "istream::operator>>(unsigned long &)" |
test_demangling_exact "lucid: __rs__7istreamFRUs" "istream::operator>>(unsigned short &)" |
test_demangling_exact "lucid: __rs__7istreamFRd" "istream::operator>>(double &)" |
test_demangling_exact "lucid: __rs__7istreamFRf" "istream::operator>>(float &)" |
test_demangling_exact "lucid: __rs__7istreamFRi" "istream::operator>>(int &)" |
test_demangling_exact "lucid: __rs__7istreamFRl" "istream::operator>>(long &)" |
test_demangling_exact "lucid: __rs__7istreamFRs" "istream::operator>>(short &)" |
test_demangling_exact "lucid: __rs__FR7istreamR7complex" "operator>>(istream &, complex &)" |
test_demangling "lucid: __vc__3fooFR3foo" "foo::operator\\\[\\\]\\(foo &\\)" |
test_demangling_exact "lucid: __vtbl__10istrstream" "istrstream virtual table" |
test_demangling_exact "lucid: __vtbl__17ostream__iostream__19iostream_withassign" "iostream_withassign::ostream__iostream virtual table" |
|
test_demangling_exact "lucid: __vtbl__3ios" "ios virtual table" |
test_demangling_exact "lucid: __vtbl__3ios__13strstreambase" "strstreambase::ios virtual table" |
|
# GDB 930414 demangles this as t_cc_main_ (obviously wrong). |
# GDB 930701 gets into an infinite loop. |
# GDB 930727 says "Can't demangle". |
# What is the correct demangling? FIXME. |
|
# NOTE: carlton/2003-01-17: No, don't FIXME, just obsolete lucid. |
# I'm KFAILing this rather than deleting it for form's sake. |
setup_kfail "gdb/945" "*-*-*" |
test_demangling_exact "lucid: __vtbl__3foo__vt_cc_main_" "" |
|
test_demangling_exact "lucid: abs__F7complex" "abs(complex)" |
test_demangling_exact "lucid: allocate__9streambufFv" "streambuf::allocate(void)" |
test_demangling_exact "lucid: attach__11fstreambaseFi" "fstreambase::attach(int)" |
test_demangling_exact "lucid: bitalloc__3iosSFv" "ios::bitalloc(void) static" |
test_demangling_exact "lucid: chr__FiT1" "chr(int, int)" |
test_demangling_exact "lucid: complex_error__FR11c_exception" "complex_error(c_exception &)" |
test_demangling_exact "lucid: complexfunc2__FPFPc_i" "complexfunc2(int (*)(char *))" |
test_demangling_exact "lucid: complexfunc3__FPFPFPl_s_i" "complexfunc3(int (*)(short (*)(long *)))" |
|
test_demangling_exact "lucid: complexfunc4__FPFPFPc_s_i" "complexfunc4(int (*)(short (*)(char *)))" |
test_demangling_exact "lucid: complexfunc5__FPFPc_PFl_i" "complexfunc5(int (*(*)(char *))(long))" |
test_demangling_exact "lucid: complexfunc6__FPFPi_PFl_i" "complexfunc6(int (*(*)(int *))(long))" |
test_demangling_exact "lucid: complexfunc7__FPFPFPc_i_PFl_i" "complexfunc7(int (*(*)(int (*)(char *)))(long))" |
test_demangling_exact "lucid: complicated_put__7ostreamFc" "ostream::complicated_put(char)" |
test_demangling_exact "lucid: conv10__FlPc" "conv10(long, char *)" |
test_demangling_exact "lucid: conv16__FUlPc" "conv16(unsigned long, char *)" |
test_demangling_exact "lucid: dec__FR3ios" "dec(ios &)" |
test_demangling_exact "lucid: dec__Fli" "dec(long, int)" |
test_demangling_exact "lucid: dofield__FP7ostreamPciT2T3" "dofield(ostream *, char *, int, char *, int)" |
|
test_demangling_exact "lucid: flags__3iosFl" "ios::flags(long)" |
test_demangling_exact "lucid: flags__3iosFv" "ios::flags(void)" |
test_demangling_exact "lucid: foo__FiN31" "foo(int, int, int, int)" |
test_demangling_exact "lucid: foo__FiR3fooT1T2T1T2" "foo(int, foo &, int, foo &, int, foo &)" |
test_demangling_exact "lucid: foo___3barFl" "bar::foo_(long)" |
test_demangling "lucid: form__FPCce" "form\[(\]+(const char|char const) \[*\]+,...\[)\]+" |
test_demangling_exact "lucid: get__7istreamFPcic" "istream::get(char *, int, char)" |
test_demangling_exact "lucid: get__7istreamFR9streambufc" "istream::get(streambuf &, char)" |
test_demangling_exact "lucid: get_complicated__7istreamFRUc" "istream::get_complicated(unsigned char &)" |
test_demangling_exact "lucid: get_complicated__7istreamFRc" "istream::get_complicated(char &)" |
test_demangling_exact "lucid: getline__7istreamFPUcic" "istream::getline(unsigned char *, int, char)" |
test_demangling_exact "lucid: getline__7istreamFPcic" "istream::getline(char *, int, char)" |
|
test_demangling_exact "lucid: ignore__7istreamFiT1" "istream::ignore(int, int)" |
test_demangling_exact "lucid: init__12strstreambufFPciT1" "strstreambuf::init(char *, int, char *)" |
test_demangling_exact "lucid: init__3iosFP9streambuf" "ios::init(streambuf *)" |
test_demangling_exact "lucid: initcount__13Iostream_init" "Iostream_init::initcount" |
test_demangling_exact "lucid: ipfx__7istreamFi" "istream::ipfx(int)" |
test_demangling_exact "lucid: ls_complicated__7ostreamFUc" "ostream::ls_complicated(unsigned char)" |
test_demangling_exact "lucid: ls_complicated__7ostreamFc" "ostream::ls_complicated(char)" |
test_demangling "lucid: open__11fstreambaseFPCciT2" \ |
"fstreambase::open\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
test_demangling "lucid: open__7filebufFPCciT2" \ |
"filebuf::open\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" |
|
test_demangling_exact "lucid: overload1arg__FSc" "overload1arg(signed char)" |
test_demangling_exact "lucid: overload1arg__FUc" "overload1arg(unsigned char)" |
test_demangling_exact "lucid: overload1arg__FUi" "overload1arg(unsigned int)" |
test_demangling_exact "lucid: overload1arg__FUl" "overload1arg(unsigned long)" |
test_demangling_exact "lucid: overload1arg__FUs" "overload1arg(unsigned short)" |
test_demangling_exact "lucid: overload1arg__Fc" "overload1arg(char)" |
test_demangling_exact "lucid: overload1arg__Fd" "overload1arg(double)" |
test_demangling_exact "lucid: overload1arg__Ff" "overload1arg(float)" |
test_demangling_exact "lucid: overload1arg__Fi" "overload1arg(int)" |
test_demangling_exact "lucid: overload1arg__Fl" "overload1arg(long)" |
test_demangling_exact "lucid: overload1arg__Fs" "overload1arg(short)" |
test_demangling_exact "lucid: overload1arg__Fv" "overload1arg(void)" |
test_demangling_exact "lucid: overloadargs__FiN21" "overloadargs(int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN31" "overloadargs(int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN41" "overloadargs(int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN51" "overloadargs(int, int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN61" "overloadargs(int, int, int, int, int, int, int)" |
|
test_demangling_exact "lucid: overloadargs__FiN71" "overloadargs(int, int, int, int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN81" "overloadargs(int, int, int, int, int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN91" "overloadargs(int, int, int, int, int, int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiN91N11" "overloadargs(int, int, int, int, int, int, int, int, int, int, int)" |
test_demangling_exact "lucid: overloadargs__FiT1" "overloadargs(int, int)" |
test_demangling_exact "lucid: polar__FdT1" "polar(double, double)" |
test_demangling_exact "lucid: pow__F7complexT1" "pow(complex, complex)" |
test_demangling_exact "lucid: pow__F7complexd" "pow(complex, double)" |
test_demangling_exact "lucid: pow__F7complexi" "pow(complex, int)" |
test_demangling_exact "lucid: pow__Fd7complex" "pow(double, complex)" |
test_demangling_exact "lucid: pstart__FPciT2" "pstart(char *, int, int)" |
test_demangling_exact "lucid: put__7ostreamFc" "ostream::put(char)" |
|
test_demangling_exact "lucid: read__7istreamFPci" "istream::read(char *, int)" |
test_demangling_exact "lucid: resetiosflags__FR3iosl" "resetiosflags(ios &, long)" |
test_demangling_exact "lucid: restore_errno__FRi" "restore_errno(int &)" |
test_demangling_exact "lucid: rs_complicated__7istreamFRUc" "istream::rs_complicated(unsigned char &)" |
test_demangling_exact "lucid: rs_complicated__7istreamFRc" "istream::rs_complicated(char &)" |
test_demangling_exact "lucid: seekg__7istreamFl8seek_dir" "istream::seekg(long, seek_dir)" |
test_demangling_exact "lucid: seekoff__12strstreambufFl8seek_diri" "strstreambuf::seekoff(long, seek_dir, int)" |
test_demangling_exact "lucid: seekoff__9streambufFlQ2_3ios12ios_seek_diri" "streambuf::seekoff(long, ios::ios_seek_dir, int)" |
test_demangling_exact "lucid: seekpos__9streambufFli" "streambuf::seekpos(long, int)" |
test_demangling_exact "lucid: set_new_handler__FPFv_v" "set_new_handler(void (*)(void))" |
test_demangling_exact "lucid: setb__9streambufFPcT1i" "streambuf::setb(char *, char *, int)" |
|
test_demangling_exact "lucid: setb__FR3iosi" "setb(ios &, int)" |
test_demangling_exact "lucid: setbuf__11fstreambaseFPci" "fstreambase::setbuf(char *, int)" |
test_demangling_exact "lucid: setbuf__9streambufFPUci" "streambuf::setbuf(unsigned char *, int)" |
test_demangling_exact "lucid: setbuf__9streambufFPciT2" "streambuf::setbuf(char *, int, int)" |
test_demangling_exact "lucid: setf__3iosFlT1" "ios::setf(long, long)" |
test_demangling_exact "lucid: setfill__FR3iosi" "setfill(ios &, int)" |
test_demangling_exact "lucid: setg__9streambufFPcN21" "streambuf::setg(char *, char *, char *)" |
test_demangling_exact "lucid: setp__9streambufFPcT1" "streambuf::setp(char *, char *)" |
|
test_demangling "lucid: sputn__9streambufFPCci" \ |
"streambuf::sputn\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
test_demangling "lucid: str__FPCci" \ |
"str\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
test_demangling_exact "lucid: tie__3iosFP7ostream" "ios::tie(ostream *)" |
test_demangling_exact "lucid: uconv10__FUlPc" "uconv10(unsigned long, char *)" |
|
test_demangling "lucid: write__7ostreamFPCci" \ |
"ostream::write\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
test_demangling_exact "lucid: xget__7istreamFPc" "istream::xget(char *)" |
test_demangling_exact "lucid: xsgetn__9streambufFPci" "streambuf::xsgetn(char *, int)" |
test_demangling "lucid: xsputn__9streambufFPCci" \ |
"streambuf::xsputn\[(\]+(const char|char const) \[*\]+, int\[)\]+" |
|
test_demangling_exact "lucid: _Utf390_1__1_9223372036854775807__9223372036854775" \ |
"Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\"" |
} |
|
# |
# Test arm style name demangling |
# |
|
proc test_arm_style_demangling {} { |
test_demangling_exact "arm: __dt__21T5__pt__11_PFiPPdPv_iFv" "T5<int (*)(int, double **, void *)>::~T5(void)" |
|
test_demangling_exact "arm: __ct__1cFi" "c::c(int)" |
|
test_demangling_exact "arm: __dt__11T5__pt__2_iFv" "T5<int>::~T5(void)" |
|
test_demangling_exact "arm: __dt__11T5__pt__2_cFv" "T5<char>::~T5(void)" |
|
test_demangling_exact "arm: __ct__2T2Fi" "T2::T2(int)" |
test_demangling_exact "arm: __dt__2T1Fv" "T1::~T1(void)" |
|
test_demangling_exact "arm: __dt__12T5__pt__3_1xFv" "T5<x>::~T5(void)" |
|
test_demangling_exact "arm: __dt__17T5__pt__8_PFcPv_iFv" "T5<int (*)(char, void *)>::~T5(void)" |
|
test_demangling "arm: g__FP1cPC1cT1" \ |
"g\[(\]+c *\[*\]+, (const c|c const) *\[*\]+, c *\[*\]+\[)\]+" |
test_demangling "arm: g__FPUlPCUlT1" \ |
"g\[(\]+unsigned long \[*\]+, (const unsigned long|unsigned long const) \[*\]+, unsigned long \[*\]+\[)\]+" |
test_demangling "arm: g__FPUiPCUiT1" \ |
"g\[(\]+unsigned int \[*\]+, (const unsigned int|unsigned int const) \[*\]+, unsigned int \[*\]+\[)\]+" |
test_demangling "arm: g__FPUsPCUsT1" \ |
"g\[(\]+unsigned short \[*\]+, (const unsigned short|unsigned short const) \[*\]+, unsigned short \[*\]+\[)\]+" |
test_demangling "arm: g__FPUcPCUcT1" \ |
"g\[(\]+unsigned char \[*\]+, (const unsigned char|unsigned char const) \[*\]+, unsigned char \[*\]+\[)\]+" |
test_demangling "arm: g__F1TPlPClT2" \ |
"g\[(\]+T, long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+" |
test_demangling "arm: g__F1RRlRClT2" \ |
"g\[(\]+R, long &, (const long|long const) &, long &\[)\]+" |
test_demangling "arm: g__F1TPiPCiT2" \ |
"g\[(\]+T, int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+" |
test_demangling "arm: g__F1RRiRCiT2" \ |
"g\[(\]+R, int &, (const int|int const) &, int &\[)\]+" |
test_demangling "arm: g__F1TPsPCsT2" \ |
"g\[(\]+T, short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+" |
test_demangling "arm: g__F1RRsRCsT2" \ |
"g\[(\]+R, short &, (const short|short const) &, short &\[)\]+" |
test_demangling "arm: g__F1TPcPCcT2" \ |
"g\[(\]+T, char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+" |
test_demangling "arm: g__F1RRcRCcT2" \ |
"g\[(\]+R, char &, (const char|char const) &, char &\[)\]+" |
|
test_demangling_exact "arm: __ct__21T5__pt__11_PFiPPdPv_iFi" "T5<int (*)(int, double **, void *)>::T5(int)" |
|
test_demangling "arm: __gt__FRC2T2c" \ |
"operator>\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "arm: __ge__FRC2T2c" \ |
"operator>=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "arm: __lt__FRC2T2c" \ |
"operator<\[(\]+(const T2|T2 const) &, char\[)\]+" |
|
test_demangling "arm: __le__FRC2T2c" \ |
"operator<=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "arm: __ne__FRC2T2c" \ |
"operator!=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "arm: __eq__FRC2T2c" \ |
"operator==\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling_exact "arm: __amd__FR2T2i" "operator%=(T2 &, int)" |
test_demangling_exact "arm: __adv__FR2T2i" "operator/=(T2 &, int)" |
test_demangling_exact "arm: __amu__FR2T2i" "operator*=(T2 &, int)" |
test_demangling_exact "arm: __ami__FR2T2i" "operator-=(T2 &, int)" |
test_demangling_exact "arm: __apl__FR2T2i" "operator+=(T2 &, int)" |
test_demangling_exact "arm: __nw__2T1SFUi" "T1::operator new(unsigned int) static" |
test_demangling_exact "arm: __dl__2T1SFPv" "T1::operator delete(void *) static" |
test_demangling_exact "arm: put__2T7SFi" "T7::put(int) static" |
|
test_demangling_exact "arm: __dl__12T5__pt__3_1xSFPv" "T5<x>::operator delete(void *) static" |
|
test_demangling_exact "arm: h__FUc" "h(unsigned char)" |
test_demangling_exact "arm: f__Fic" "f(int, char)" |
test_demangling_exact "arm: h__FUi" "h(unsigned int)" |
test_demangling_exact "arm: h__Fci" "h(char, int)" |
test_demangling_exact "arm: h__FUl" "h(unsigned long)" |
test_demangling_exact "arm: h__Fcl" "h(char, long)" |
test_demangling_exact "arm: h__FUs" "h(unsigned short)" |
test_demangling_exact "arm: h__Fcs" "h(char, short)" |
test_demangling "arm: __amd__FR2T2RC2T2" \ |
"operator%=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __adv__FR2T2RC2T2" \ |
"operator/=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __amu__FR2T2RC2T2" \ |
"operator\[*\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __ami__FR2T2RC2T2" \ |
"operator-=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __apl__FR2T2RC2T2" \ |
"operator\[+\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
|
test_demangling "arm: g__F1SRPUlRPCUlT2" \ |
"g\[(\]+S, unsigned long \[*\]+&, (const unsigned long|unsigned long const) \[*\]+&, unsigned long \[*\]+&\[)\]+" |
test_demangling "arm: g__F1SRPUiRPCUiT2" \ |
"g\[(\]+S, unsigned int \[*\]+&, (const unsigned int|unsigned int const) \[*\]+&, unsigned int \[*\]+&\[)\]+" |
test_demangling "arm: g__F1SRPUsRPCUsT2" \ |
"g\[(\]+S, unsigned short \[*\]+&, (const unsigned short|unsigned short const) \[*\]+&, unsigned short \[*\]+&\[)\]+" |
test_demangling "arm: g__F1SRPUcRPCUcT2" \ |
"g\[(\]+S, unsigned char \[*\]+&, (const unsigned char|unsigned char const) \[*\]+&, unsigned char \[*\]+&\[)\]+" |
test_demangling "arm: g__F1T1SRPlRPClT3" \ |
"g\[(\]+T, S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+" |
test_demangling "arm: g__F1T1SRPiRPCiT3" \ |
"g\[(\]+T, S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+" |
test_demangling "arm: g__F1T1SRPcRPCcT3" \ |
"g\[(\]+T, S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+" |
|
test_demangling_exact "arm: X__12T5__pt__3_1x" "T5<x>::X" |
|
test_demangling_exact "arm: __ct__11T5__pt__2_iFi" "T5<int>::T5(int)" |
|
test_demangling_exact "arm: __ct__11T5__pt__2_cFi" "T5<char>::T5(int)" |
|
test_demangling "arm: __gt__FRC2T2T1" \ |
"operator>\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __ge__FRC2T2T1" \ |
"operator>=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __lt__FRC2T2T1" \ |
"operator<\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __le__FRC2T2T1" \ |
"operator<=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __ne__FRC2T2T1" \ |
"operator!=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __eq__FRC2T2T1" \ |
"operator==\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "arm: g__FcR1cRC1cT2" \ |
"g\[(\]+char, c &, (const c|c const) &, c &\[)\]+" |
test_demangling "arm: g__FcRPdRPCdT2" \ |
"g\[(\]+char, double *\[*\]+&, (const double|double const) *\[*\]+&, double *\[*\]+&\[)\]+" |
test_demangling "arm: g__FcRPfRPCfT2" \ |
"g\[(\]+char, float *\[*\]+&, (const float|float const) *\[*\]+&, float *\[*\]+&\[)\]+" |
test_demangling_exact "arm: h__FcT1" "h(char, char)" |
test_demangling_exact "arm: f__Ficd" "f(int, char, double)" |
test_demangling "arm: g__F1T1SdRPsRPCsT4" \ |
"g\[(\]+T, S, double, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+" |
test_demangling "arm: g__F1cC1cT1" \ |
"g\[(\]+c, (const c|c const), c\[)\]+" |
test_demangling "arm: g__FPdPCdT1" \ |
"g\[(\]+double *\[*\]+, (const double|double const) *\[*\]+, double *\[*\]+\[)\]+" |
test_demangling "arm: g__FPfPCfT1" \ |
"g\[(\]+float *\[*\]+, (const float|float const) *\[*\]+, float *\[*\]+\[)\]+" |
|
test_demangling "arm: g__FUlCUlT1" \ |
"g\[(\]+unsigned long, (const unsigned long|unsigned long const), unsigned long\[)\]+" |
test_demangling "arm: g__FPlPClT1" \ |
"g\[(\]+long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+" |
test_demangling "arm: g__FUiCUiT1" \ |
"g\[(\]+unsigned int, (const unsigned int|unsigned int const), unsigned int\[)\]+" |
test_demangling "arm: g__FPiPCiT1" \ |
"g\[(\]+int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+" |
test_demangling "arm: g__FUsCUsT1" \ |
"g\[(\]+unsigned short, (const unsigned short|unsigned short const), unsigned short\[)\]+" |
test_demangling "arm: g__FPsPCsT1" \ |
"g\[(\]+short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+" |
test_demangling "arm: g__FUcCUcT1" \ |
"g\[(\]+unsigned char, (const unsigned char|unsigned char const), unsigned char\[)\]+" |
test_demangling "arm: g__FPcPCcT1" \ |
"g\[(\]+char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+" |
test_demangling "arm: g__F1TlClT2" \ |
"g\[(\]+T, long, (const long|long const), long\[)\]+" |
test_demangling "arm: g__F1TiCiT2" \ |
"g\[(\]+T, int, (const int|int const), int\[)\]+" |
test_demangling "arm: g__F1TsCsT2" \ |
"g\[(\]+T, short, (const short|short const), short\[)\]+" |
test_demangling "arm: g__F1TcCcT2" \ |
"g\[(\]+T, char, (const char|char const), char\[)\]+" |
|
test_demangling_exact "arm: __dl__17T5__pt__8_PFcPv_iSFPv" "T5<int (*)(char, void *)>::operator delete(void *) static" |
|
test_demangling "arm: printf__FPCce" \ |
"printf\[(\]+(const char|char const) \[*\]+,...\[)\]+" |
|
test_demangling_exact "arm: X__17T5__pt__8_PFcPv_i" "T5<int (*)(char, void *)>::X" |
|
test_demangling_exact "arm: __ct__12T5__pt__3_1xFi" "T5<x>::T5(int)" |
|
test_demangling "arm: g__F1SRUlRCUlT2" \ |
"g\[(\]+S, unsigned long &, (const unsigned long|unsigned long const) &, unsigned long &\[)\]+" |
test_demangling "arm: g__F1SRPlRPClT2" \ |
"g\[(\]+S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+" |
test_demangling "arm: g__F1RRUiRCUiT2" \ |
"g\[(\]+R, unsigned int &, (const unsigned int|unsigned int const) &, unsigned int &\[)\]+" |
test_demangling "arm: g__F1SRPiRPCiT2" \ |
"g\[(\]+S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+" |
test_demangling "arm: g__F1RRUsRCUsT2" \ |
"g\[(\]+R, unsigned short &, (const unsigned short|unsigned short const) &, unsigned short &\[)\]+" |
test_demangling "arm: g__F1SRPsRPCsT2" \ |
"g\[(\]+S, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+" |
test_demangling "arm: g__F1RRUcRCUcT2" \ |
"g\[(\]+R, unsigned char &, (const unsigned char|unsigned char const) &, unsigned char &\[)\]+" |
test_demangling "arm: g__F1SRPcRPCcT2" \ |
"g\[(\]+S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+" |
test_demangling "arm: g__F1T1RRlRClT3" \ |
"g\[(\]+T, R, long &, (const long|long const) &, long &\[)\]+" |
test_demangling "arm: g__F1T1RRiRCiT3" \ |
"g\[(\]+T, R, int &, (const int|int const) &, int &\[)\]+" |
test_demangling "arm: g__F1T1RRsRCsT3" \ |
"g\[(\]+T, R, short &, (const short|short const) &, short &\[)\]+" |
test_demangling "arm: g__F1T1RRcRCcT3" \ |
"g\[(\]+T, R, char &, (const char|char const) &, char &\[)\]+" |
|
test_demangling_exact "arm: __dl__21T5__pt__11_PFiPPdPv_iSFPv" "T5<int (*)(int, double **, void *)>::operator delete(void *) static" |
|
test_demangling_exact "arm: __std__foo" "global destructors keyed to foo" |
|
test_demangling_exact "arm: __sti__bar" "global constructors keyed to bar" |
|
test_demangling_exact "arm: f__FicdPcPFci_v" "f(int, char, double, char *, void (*)(char, int))" |
test_demangling_exact "arm: f__FicdPcPFic_v" "f(int, char, double, char *, void (*)(int, char))" |
test_demangling_exact "arm: get__2T7SFv" "T7::get(void) static" |
|
test_demangling_exact "arm: X__21T5__pt__11_PFiPPdPv_i" "T5<int (*)(int, double **, void *)>::X" |
|
test_demangling "arm: g__FcRdRCdT2" \ |
"g\[(\]+char, double &, (const double|double const) &, double &\[)\]+" |
test_demangling "arm: g__FcRfRCfT2" \ |
"g\[(\]+char, float &, (const float|float const) &, float &\[)\]+" |
test_demangling "arm: __md__FC2T2i" \ |
"operator%\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "arm: __dv__FC2T2i" \ |
"operator/\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "arm: __ml__FC2T2i" \ |
"operator\[*\]+\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "arm: __mi__FC2T2i" \ |
"operator-\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "arm: __pl__FC2T2i" \ |
"operator\[+\]+\[(\]+(const T2|T2 const), int\[)\]+" |
|
test_demangling_exact "arm: __dl__11T5__pt__2_iSFPv" "T5<int>::operator delete(void *) static" |
|
test_demangling_exact "arm: __dl__11T5__pt__2_cSFPv" "T5<char>::operator delete(void *) static" |
|
test_demangling_exact "arm: h__Fc" "h(char)" |
test_demangling_exact "arm: h__Fd" "h(double)" |
test_demangling_exact "arm: h__Ff" "h(float)" |
test_demangling_exact "arm: h__Fi" "h(int)" |
test_demangling_exact "arm: f__Fi" "f(int)" |
test_demangling_exact "arm: h__Fl" "h(long)" |
|
test_demangling_exact "arm: h__Fs" "h(short)" |
test_demangling "arm: __md__FC2T2RC2T2" \ |
"operator%\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __dv__FC2T2RC2T2" \ |
"operator/\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __ml__FC2T2RC2T2" \ |
"operator\[*\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __mi__FC2T2RC2T2" \ |
"operator-\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "arm: __pl__FC2T2RC2T2" \ |
"operator\[+\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "arm: g__FcRP1cRPC1cT2" \ |
"g\[(\]+char, c *\[*\]+&, (const c|c const) *\[*\]+&, c *\[*\]+&\[)\]+" |
|
test_demangling_exact "arm: X__11T5__pt__2_c" "T5<char>::X" |
|
test_demangling_exact "arm: X__11T5__pt__2_i" "T5<int>::X" |
|
test_demangling "arm: g__FdCdT1" \ |
"g\[(\]+double, (const double|double const), double\[)\]+" |
test_demangling "arm: g__FfCfT1" \ |
"g\[(\]+float, (const float|float const), float\[)\]+" |
test_demangling "arm: g__FlClT1" \ |
"g\[(\]+long, (const long|long const), long\[)\]+" |
test_demangling "arm: g__FiCiT1" \ |
"g\[(\]+int, (const int|int const), int\[)\]+" |
test_demangling "arm: g__FsCsT1" \ |
"g\[(\]+short, (const short|short const), short\[)\]+" |
test_demangling "arm: g__FcCcT1" \ |
"g\[(\]+char, (const char|char const), char\[)\]+" |
|
test_demangling_exact "arm: __ct__17T5__pt__8_PFcPv_iFi" "T5<int (*)(char, void *)>::T5(int)" |
|
test_demangling_exact "arm: f__FicdPc" "f(int, char, double, char *)" |
test_demangling_exact "arm: __nw__FUi" "operator new(unsigned int)" |
test_demangling_exact "arm: __ct__Q3_2T11a1bSFi" "T1::a::b::b(int) static" |
test_demangling_exact "arm: __dt__Q3_2T11a1bSFi" "T1::a::b::~b(int) static" |
test_demangling_exact "arm: put__Q3_2T11a1bSFi" "T1::a::b::put(int) static" |
test_demangling_exact "arm: get__Q2_2T11aSFv" "T1::a::get(void) static" |
test_demangling_exact "arm: put__2T1SFi" "T1::put(int) static" |
test_demangling_exact "arm: put__Q5_2T11a1b1c1dSFi" "T1::a::b::c::d::put(int) static" |
test_demangling_exact "arm: get__Q4_2T11a1b1cSFv" "T1::a::b::c::get(void) static" |
test_demangling_exact "arm: put__Q2_2T11aSFi" "T1::a::put(int) static" |
test_demangling_exact "arm: put__Q4_2T11a1b1cSFi" "T1::a::b::c::put(int) static" |
test_demangling_exact "arm: get__Q3_2T11a1bSFv" "T1::a::b::get(void) static" |
test_demangling_exact "arm: get__2T1SFv" "T1::get(void) static" |
test_demangling_exact "arm: get__Q5_2T11a1b1c1dSFv" "T1::a::b::c::d::get(void) static" |
|
test_demangling_exact "arm: __dt__11T1__pt__2_cFv" "T1<char>::~T1(void)" |
|
test_demangling_exact "arm: __dt__12T1__pt__3_1tFv" "T1<t>::~T1(void)" |
|
test_demangling_exact "arm: __dl__12T1__pt__3_1tSFPv" "T1<t>::operator delete(void *) static" |
|
test_demangling_exact "arm: __ct__11T1__pt__2_cFi" "T1<char>::T1(int)" |
|
test_demangling_exact "arm: __ct__11T1__pt__2_cFv" "T1<char>::T1(void)" |
|
test_demangling_exact "arm: __ct__12T1__pt__3_1tFi" "T1<t>::T1(int)" |
|
test_demangling_exact "arm: __ct__12T1__pt__3_1tFv" "T1<t>::T1(void)" |
|
test_demangling_exact "arm: __dl__11T1__pt__2_cSFPv" "T1<char>::operator delete(void *) static" |
|
test_demangling_exact "arm: bar__3fooFPv" "foo::bar(void *)" |
test_demangling "arm: bar__3fooFPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+" |
test_demangling_exact "arm: bar__3fooCFPv" "foo::bar(void *) const" |
test_demangling "arm: bar__3fooCFPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const" |
test_demangling_exact "arm: __eq__3fooFR3foo" "foo::operator==(foo &)" |
test_demangling "arm: __eq__3fooFRC3foo" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+" |
test_demangling_exact "arm: __eq__3fooCFR3foo" "foo::operator==(foo &) const" |
test_demangling "arm: __eq__3fooCFRC3foo" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const" |
|
test_demangling_exact "arm: elem__15vector__pt__2_dFi" "vector<double>::elem(int)" |
|
test_demangling_exact "arm: elem__15vector__pt__2_iFi" "vector<int>::elem(int)" |
|
test_demangling_exact "arm: __ct__15vector__pt__2_dFi" "vector<double>::vector(int)" |
|
test_demangling_exact "arm: __ct__15vector__pt__2_iFi" "vector<int>::vector(int)" |
|
test_demangling_exact "arm: __ct__25DListNode__pt__9_R6RLabelFR6RLabelP25DListNode__pt__9_R6RLabelT2" \ |
"DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *)" |
|
test_demangling_exact "arm: bar__3fooFiT16FooBar" "foo::bar(int, int, FooBar)" |
|
test_demangling_exact "arm: bar__3fooFPiN51PdN37PcN211T1iN215" \ |
"foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int)" |
|
test_demangling_exact "arm: _Utf390_1__1_9223372036854775807__9223372036854775" \ |
"Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\"" |
} |
|
proc test_hp_style_demangling {} { |
|
# HP aCC mangling style is based on ARM for all the basic stuff, |
# so first we use some of the ARM tests here. Later we have HP-specific |
# tests. |
|
test_demangling "hp: g__FP1cPC1cT1" \ |
"g\[(\]+c *\[*\]+, (const c|c const) *\[*\]+, c *\[*\]+\[)\]+" |
test_demangling "hp: g__FPUlPCUlT1" \ |
"g\[(\]+unsigned long \[*\]+, (const unsigned long|unsigned long const) \[*\]+, unsigned long \[*\]+\[)\]+" |
test_demangling "hp: g__FPUiPCUiT1" \ |
"g\[(\]+unsigned int \[*\]+, (const unsigned int|unsigned int const) \[*\]+, unsigned int \[*\]+\[)\]+" |
test_demangling "hp: g__FPUsPCUsT1" \ |
"g\[(\]+unsigned short \[*\]+, (const unsigned short|unsigned short const) \[*\]+, unsigned short \[*\]+\[)\]+" |
test_demangling "hp: g__FPUcPCUcT1" \ |
"g\[(\]+unsigned char \[*\]+, (const unsigned char|unsigned char const) \[*\]+, unsigned char \[*\]+\[)\]+" |
test_demangling "hp: g__F1TPlPClT2" \ |
"g\[(\]+T, long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+" |
test_demangling "hp: g__F1RRlRClT2" \ |
"g\[(\]+R, long &, (const long|long const) &, long &\[)\]+" |
test_demangling "hp: g__F1TPiPCiT2" \ |
"g\[(\]+T, int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+" |
test_demangling "hp: g__F1RRiRCiT2" \ |
"g\[(\]+R, int &, (const int|int const) &, int &\[)\]+" |
test_demangling "hp: g__F1TPsPCsT2" \ |
"g\[(\]+T, short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+" |
test_demangling "hp: g__F1RRsRCsT2" \ |
"g\[(\]+R, short &, (const short|short const) &, short &\[)\]+" |
test_demangling "hp: g__F1TPcPCcT2" \ |
"g\[(\]+T, char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+" |
test_demangling "hp: g__F1RRcRCcT2" \ |
"g\[(\]+R, char &, (const char|char const) &, char &\[)\]+" |
|
test_demangling "hp: __gt__FRC2T2c" \ |
"operator>\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "hp: __ge__FRC2T2c" \ |
"operator>=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "hp: __lt__FRC2T2c" \ |
"operator<\[(\]+(const T2|T2 const) &, char\[)\]+" |
|
test_demangling "hp: __le__FRC2T2c" \ |
"operator<=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "hp: __ne__FRC2T2c" \ |
"operator!=\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling "hp: __eq__FRC2T2c" \ |
"operator==\[(\]+(const T2|T2 const) &, char\[)\]+" |
test_demangling_exact "hp: __amd__FR2T2i" "operator%=(T2 &, int)" |
test_demangling_exact "hp: __adv__FR2T2i" "operator/=(T2 &, int)" |
test_demangling_exact "hp: __amu__FR2T2i" "operator*=(T2 &, int)" |
test_demangling_exact "hp: __ami__FR2T2i" "operator-=(T2 &, int)" |
test_demangling_exact "hp: __apl__FR2T2i" "operator+=(T2 &, int)" |
test_demangling_exact "hp: __nw__2T1SFUi" "T1::operator new(unsigned int) static" |
test_demangling_exact "hp: __dl__2T1SFPv" "T1::operator delete(void *) static" |
test_demangling_exact "hp: put__2T7SFi" "T7::put(int) static" |
|
test_demangling_exact "hp: h__FUc" "h(unsigned char)" |
test_demangling_exact "hp: f__Fic" "f(int, char)" |
test_demangling_exact "hp: h__FUi" "h(unsigned int)" |
test_demangling_exact "hp: h__Fci" "h(char, int)" |
test_demangling_exact "hp: h__FUl" "h(unsigned long)" |
test_demangling_exact "hp: h__Fcl" "h(char, long)" |
test_demangling_exact "hp: h__FUs" "h(unsigned short)" |
test_demangling_exact "hp: h__Fcs" "h(char, short)" |
test_demangling "hp: __amd__FR2T2RC2T2" \ |
"operator%=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __adv__FR2T2RC2T2" \ |
"operator/=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __amu__FR2T2RC2T2" \ |
"operator\[*\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __ami__FR2T2RC2T2" \ |
"operator-=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __apl__FR2T2RC2T2" \ |
"operator\[+\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+" |
|
test_demangling "hp: g__F1SRPUlRPCUlT2" \ |
"g\[(\]+S, unsigned long \[*\]+&, (const unsigned long|unsigned long const) \[*\]+&, unsigned long \[*\]+&\[)\]+" |
test_demangling "hp: g__F1SRPUiRPCUiT2" \ |
"g\[(\]+S, unsigned int \[*\]+&, (const unsigned int|unsigned int const) \[*\]+&, unsigned int \[*\]+&\[)\]+" |
test_demangling "hp: g__F1SRPUsRPCUsT2" \ |
"g\[(\]+S, unsigned short \[*\]+&, (const unsigned short|unsigned short const) \[*\]+&, unsigned short \[*\]+&\[)\]+" |
test_demangling "hp: g__F1SRPUcRPCUcT2" \ |
"g\[(\]+S, unsigned char \[*\]+&, (const unsigned char|unsigned char const) \[*\]+&, unsigned char \[*\]+&\[)\]+" |
test_demangling "hp: g__F1T1SRPlRPClT3" \ |
"g\[(\]+T, S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+" |
test_demangling "hp: g__F1T1SRPiRPCiT3" \ |
"g\[(\]+T, S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+" |
test_demangling "hp: g__F1T1SRPcRPCcT3" \ |
"g\[(\]+T, S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+" |
|
|
test_demangling "hp: __gt__FRC2T2T1" \ |
"operator>\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __ge__FRC2T2T1" \ |
"operator>=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __lt__FRC2T2T1" \ |
"operator<\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __le__FRC2T2T1" \ |
"operator<=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __ne__FRC2T2T1" \ |
"operator!=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __eq__FRC2T2T1" \ |
"operator==\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+" |
test_demangling "hp: g__FcR1cRC1cT2" \ |
"g\[(\]+char, c &, (const c|c const) &, c &\[)\]+" |
test_demangling "hp: g__FcRPdRPCdT2" \ |
"g\[(\]+char, double *\[*\]+&, (const double|double const) *\[*\]+&, double *\[*\]+&\[)\]+" |
test_demangling "hp: g__FcRPfRPCfT2" \ |
"g\[(\]+char, float *\[*\]+&, (const float|float const) *\[*\]+&, float *\[*\]+&\[)\]+" |
test_demangling_exact "hp: h__FcT1" "h(char, char)" |
test_demangling_exact "hp: f__Ficd" "f(int, char, double)" |
test_demangling "hp: g__F1T1SdRPsRPCsT4" \ |
"g\[(\]+T, S, double, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+" |
test_demangling "hp: g__F1cC1cT1" \ |
"g\[(\]+c, (const c|c const), c\[)\]+" |
test_demangling "hp: g__FPdPCdT1" \ |
"g\[(\]+double *\[*\]+, (const double|double const) *\[*\]+, double *\[*\]+\[)\]+" |
test_demangling "hp: g__FPfPCfT1" \ |
"g\[(\]+float *\[*\]+, (const float|float const) *\[*\]+, float *\[*\]+\[)\]+" |
|
test_demangling "hp: g__FUlCUlT1" \ |
"g\[(\]+unsigned long, (const unsigned long|unsigned long const), unsigned long\[)\]+" |
test_demangling "hp: g__FPlPClT1" \ |
"g\[(\]+long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+" |
test_demangling "hp: g__FUiCUiT1" \ |
"g\[(\]+unsigned int, (const unsigned int|unsigned int const), unsigned int\[)\]+" |
test_demangling "hp: g__FPiPCiT1" \ |
"g\[(\]+int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+" |
test_demangling "hp: g__FUsCUsT1" \ |
"g\[(\]+unsigned short, (const unsigned short|unsigned short const), unsigned short\[)\]+" |
test_demangling "hp: g__FPsPCsT1" \ |
"g\[(\]+short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+" |
test_demangling "hp: g__FUcCUcT1" \ |
"g\[(\]+unsigned char, (const unsigned char|unsigned char const), unsigned char\[)\]+" |
test_demangling "hp: g__FPcPCcT1" \ |
"g\[(\]+char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+" |
test_demangling "hp: g__F1TlClT2" \ |
"g\[(\]+T, long, (const long|long const), long\[)\]+" |
test_demangling "hp: g__F1TiCiT2" \ |
"g\[(\]+T, int, (const int|int const), int\[)\]+" |
test_demangling "hp: g__F1TsCsT2" \ |
"g\[(\]+T, short, (const short|short const), short\[)\]+" |
test_demangling "hp: g__F1TcCcT2" \ |
"g\[(\]+T, char, (const char|char const), char\[)\]+" |
|
test_demangling "hp: printf__FPCce" \ |
"printf\[(\]+(const char|char const) \[*\]+,...\[)\]+" |
|
|
test_demangling "hp: g__F1SRUlRCUlT2" \ |
"g\[(\]+S, unsigned long &, (const unsigned long|unsigned long const) &, unsigned long &\[)\]+" |
test_demangling "hp: g__F1SRPlRPClT2" \ |
"g\[(\]+S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+" |
test_demangling "hp: g__F1RRUiRCUiT2" \ |
"g\[(\]+R, unsigned int &, (const unsigned int|unsigned int const) &, unsigned int &\[)\]+" |
test_demangling "hp: g__F1SRPiRPCiT2" \ |
"g\[(\]+S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+" |
test_demangling "hp: g__F1RRUsRCUsT2" \ |
"g\[(\]+R, unsigned short &, (const unsigned short|unsigned short const) &, unsigned short &\[)\]+" |
test_demangling "hp: g__F1SRPsRPCsT2" \ |
"g\[(\]+S, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+" |
test_demangling "hp: g__F1RRUcRCUcT2" \ |
"g\[(\]+R, unsigned char &, (const unsigned char|unsigned char const) &, unsigned char &\[)\]+" |
test_demangling "hp: g__F1SRPcRPCcT2" \ |
"g\[(\]+S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+" |
test_demangling "hp: g__F1T1RRlRClT3" \ |
"g\[(\]+T, R, long &, (const long|long const) &, long &\[)\]+" |
test_demangling "hp: g__F1T1RRiRCiT3" \ |
"g\[(\]+T, R, int &, (const int|int const) &, int &\[)\]+" |
test_demangling "hp: g__F1T1RRsRCsT3" \ |
"g\[(\]+T, R, short &, (const short|short const) &, short &\[)\]+" |
test_demangling "hp: g__F1T1RRcRCcT3" \ |
"g\[(\]+T, R, char &, (const char|char const) &, char &\[)\]+" |
|
|
test_demangling_exact "hp: f__FicdPcPFci_v" "f(int, char, double, char *, void (*)(char, int))" |
test_demangling_exact "hp: f__FicdPcPFic_v" "f(int, char, double, char *, void (*)(int, char))" |
test_demangling_exact "hp: get__2T7SFv" "T7::get(void) static" |
|
|
test_demangling "hp: g__FcRdRCdT2" \ |
"g\[(\]+char, double &, (const double|double const) &, double &\[)\]+" |
test_demangling "hp: g__FcRfRCfT2" \ |
"g\[(\]+char, float &, (const float|float const) &, float &\[)\]+" |
test_demangling "hp: __md__FC2T2i" \ |
"operator%\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "hp: __dv__FC2T2i" \ |
"operator/\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "hp: __ml__FC2T2i" \ |
"operator\[*\]+\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "hp: __mi__FC2T2i" \ |
"operator-\[(\]+(const T2|T2 const), int\[)\]+" |
test_demangling "hp: __pl__FC2T2i" \ |
"operator\[+\]+\[(\]+(const T2|T2 const), int\[)\]+" |
|
|
test_demangling_exact "hp: h__Fc" "h(char)" |
test_demangling_exact "hp: h__Fd" "h(double)" |
test_demangling_exact "hp: h__Ff" "h(float)" |
test_demangling_exact "hp: h__Fi" "h(int)" |
test_demangling_exact "hp: f__Fi" "f(int)" |
test_demangling_exact "hp: h__Fl" "h(long)" |
|
test_demangling_exact "hp: h__Fs" "h(short)" |
test_demangling "hp: __md__FC2T2RC2T2" \ |
"operator%\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __dv__FC2T2RC2T2" \ |
"operator/\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __ml__FC2T2RC2T2" \ |
"operator\[*\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __mi__FC2T2RC2T2" \ |
"operator-\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "hp: __pl__FC2T2RC2T2" \ |
"operator\[+\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+" |
test_demangling "hp: g__FcRP1cRPC1cT2" \ |
"g\[(\]+char, c *\[*\]+&, (const c|c const) *\[*\]+&, c *\[*\]+&\[)\]+" |
|
|
test_demangling "hp: g__FdCdT1" \ |
"g\[(\]+double, (const double|double const), double\[)\]+" |
test_demangling "hp: g__FfCfT1" \ |
"g\[(\]+float, (const float|float const), float\[)\]+" |
test_demangling "hp: g__FlClT1" \ |
"g\[(\]+long, (const long|long const), long\[)\]+" |
test_demangling "hp: g__FiCiT1" \ |
"g\[(\]+int, (const int|int const), int\[)\]+" |
test_demangling "hp: g__FsCsT1" \ |
"g\[(\]+short, (const short|short const), short\[)\]+" |
test_demangling "hp: g__FcCcT1" \ |
"g\[(\]+char, (const char|char const), char\[)\]+" |
|
|
test_demangling_exact "hp: f__FicdPc" "f(int, char, double, char *)" |
test_demangling_exact "hp: __nw__FUi" "operator new(unsigned int)" |
test_demangling_exact "hp: __ct__Q3_2T11a1bSFi" "T1::a::b::b(int) static" |
test_demangling_exact "hp: __dt__Q3_2T11a1bSFi" "T1::a::b::~b(int) static" |
test_demangling_exact "hp: put__Q3_2T11a1bSFi" "T1::a::b::put(int) static" |
test_demangling_exact "hp: get__Q2_2T11aSFv" "T1::a::get(void) static" |
test_demangling_exact "hp: put__2T1SFi" "T1::put(int) static" |
test_demangling_exact "hp: put__Q5_2T11a1b1c1dSFi" "T1::a::b::c::d::put(int) static" |
test_demangling_exact "hp: get__Q4_2T11a1b1cSFv" "T1::a::b::c::get(void) static" |
test_demangling_exact "hp: put__Q2_2T11aSFi" "T1::a::put(int) static" |
test_demangling_exact "hp: put__Q4_2T11a1b1cSFi" "T1::a::b::c::put(int) static" |
test_demangling_exact "hp: get__Q3_2T11a1bSFv" "T1::a::b::get(void) static" |
test_demangling_exact "hp: get__2T1SFv" "T1::get(void) static" |
test_demangling_exact "hp: get__Q5_2T11a1b1c1dSFv" "T1::a::b::c::d::get(void) static" |
|
|
test_demangling_exact "hp: bar__3fooFPv" "foo::bar(void *)" |
test_demangling "hp: bar__3fooFPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+" |
test_demangling_exact "hp: bar__3fooCFPv" "foo::bar(void *) const" |
test_demangling "hp: bar__3fooCFPCv" \ |
"foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const" |
test_demangling_exact "hp: __eq__3fooFR3foo" "foo::operator==(foo &)" |
test_demangling "hp: __eq__3fooFRC3foo" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+" |
test_demangling_exact "hp: __eq__3fooCFR3foo" "foo::operator==(foo &) const" |
test_demangling "hp: __eq__3fooCFRC3foo" \ |
"foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const" |
|
test_demangling_exact "hp: bar__3fooFiT16FooBar" "foo::bar(int, int, FooBar)" |
|
test_demangling_exact "hp: bar__3fooFPiN51PdN37PcN211T1iN215" \ |
"foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int)" |
|
|
# HP aCC specific tests. HP aCC demangling does not use __pt__ for |
# template specifications. There are other differences as well. |
|
test_demangling_exact "hp: __dt__2T5XTPFiPPdPv_i__Fv" "T5<int (*)(int, double **, void *)>::~T5(void)" |
|
test_demangling_exact "hp: __ct__1cFi" "c::c(int)" |
|
test_demangling_exact "hp: __dt__2T5XTi__Fv" "T5<int>::~T5(void)" |
|
test_demangling_exact "hp: __dt__2T5XTc__Fv" "T5<char>::~T5(void)" |
|
test_demangling_exact "hp: __ct__2T2Fi" "T2::T2(int)" |
test_demangling_exact "hp: __dt__2T1Fv" "T1::~T1(void)" |
|
test_demangling_exact "hp: __dt__2T5XT1x__Fv" "T5<x>::~T5(void)" |
|
test_demangling_exact "hp: __dt__2T5XTPFcPv_i__Fv" "T5<int (*)(char, void *)>::~T5(void)" |
|
test_demangling_exact "hp: __ct__2T5XTPFiPPdPv_i__Fi" "T5<int (*)(int, double **, void *)>::T5(int)" |
|
test_demangling_exact "hp: __dl__2T5XT1x__SFPv" "T5<x>::operator delete(void *) static" |
|
test_demangling_exact "hp: X__2T5XT1x" "T5<x>::X" |
|
test_demangling_exact "hp: __ct__2T5XTi__Fi" "T5<int>::T5(int)" |
|
test_demangling_exact "hp: __ct__2T5XTc__Fi" "T5<char>::T5(int)" |
|
test_demangling_exact "hp: __dl__2T5XTPFcPv_i__SFPv" "T5<int (*)(char, void *)>::operator delete(void *) static" |
|
test_demangling_exact "hp: X__2T5XTPFcPv_i" "T5<int (*)(char, void *)>::X" |
|
test_demangling_exact "hp: __ct__2T5XT1x__Fi" "T5<x>::T5(int)" |
|
test_demangling_exact "hp: __dl__2T5XTPFiPPdPv_i__SFPv" "T5<int (*)(int, double **, void *)>::operator delete(void *) static" |
test_demangling_exact "hp: X__2T5XTPFiPPdPv_i" "T5<int (*)(int, double **, void *)>::X" |
|
test_demangling_exact "hp: __dl__2T5XTi__SFPv" "T5<int>::operator delete(void *) static" |
|
test_demangling_exact "hp: __dl__2T5XTc__SFPv" "T5<char>::operator delete(void *) static" |
|
test_demangling_exact "hp: X__2T5XTc" "T5<char>::X" |
|
test_demangling_exact "hp: X__2T5XTi" "T5<int>::X" |
|
test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi" "T5<int (*)(char, void *)>::T5(int)" |
|
test_demangling_exact "hp: __dt__2T1XTc__Fv" "T1<char>::~T1(void)" |
|
test_demangling_exact "hp: __dt__2T1XT1t__Fv" "T1<t>::~T1(void)" |
|
test_demangling_exact "hp: __dl__2T1XT1t__SFPv" "T1<t>::operator delete(void *) static" |
|
test_demangling_exact "hp: __ct__2T1XTc__Fi" "T1<char>::T1(int)" |
|
test_demangling_exact "hp: __ct__2T1XTc__Fv" "T1<char>::T1(void)" |
|
test_demangling_exact "hp: __ct__2T1XT1t__Fi" "T1<t>::T1(int)" |
|
test_demangling_exact "hp: __ct__2T1XT1t__Fv" "T1<t>::T1(void)" |
|
test_demangling_exact "hp: __dl__2T1XTc__SFPv" "T1<char>::operator delete(void *) static" |
|
test_demangling_exact "hp: elem__6vectorXTd__Fi" "vector<double>::elem(int)" |
|
test_demangling_exact "hp: elem__6vectorXTi__Fi" "vector<int>::elem(int)" |
|
test_demangling_exact "hp: __ct__6vectorXTd__Fi" "vector<double>::vector(int)" |
|
test_demangling_exact "hp: __ct__6vectorXTi__Fi" "vector<int>::vector(int)" |
|
test_demangling_exact "hp: __ct__9DListNodeXTR6RLabel__FR6RLabelP9DListNodeXTR6RLabel_T2" \ |
"DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *)" |
|
|
# Absolute integer constants in template args |
|
test_demangling_exact "hp: elem__6vectorXTiUP34__Fi" "vector<int,34U>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXUP2701Td__Fi" "vector<2701U,double>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXTiSP334__Fi" "vector<int,334>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXTiSN67__Fi" "vector<int,-67>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXTiSM__SCFPPd" "vector<int,-2147483648>::elem(double **) static const" |
test_demangling_exact "hp: elem__6vectorXTiSN67UP4000TRs__Fi" "vector<int,-67,4000U,short &>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXTiSN67TRdTFPv_i__Fi" "vector<int,-67,double &,int (void *)>::elem(int)" |
test_demangling_exact "hp: X__6vectorXTiSN67TdTPvUP5TRs" "vector<int,-67,double,void *,5U,short &>::X" |
|
# Named constants in template args |
|
test_demangling_exact "hp: elem__6vectorXTiA3foo__Fi" "vector<int,&foo>::elem(int)" |
test_demangling_exact "hp: elem__6vectorXTiA3fooTPvA5Label__FiPPvT2" "vector<int,&foo,void *,&Label>::elem(int, void **, void **)" |
test_demangling_exact "hp: elem__6vectorXTiSN42A3foo__Fi" "vector<int,-42,&foo>::elem(int)" |
|
# Alternate entry points for functions |
|
test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi_2" "T5<int (*)(char, void *)>::T5(int)" |
test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi_19" "T5<int (*)(char, void *)>::T5(int)" |
test_demangling_exact "hp: f__FicdPcPFci_v_34" "f(int, char, double, char *, void (*)(char, int))" |
|
|
# Template partial specializations |
|
# FIXME! The # characters don't go through expect, and backslashes don't seem to work. |
# test_demangling_exact "hp: spec__13Spec<#1,#1.*>XTiTPi_FPi" "Spec<int,int *>::spec(int *)" |
# test_demangling_exact "hp: spec__16Spec<#1,#1.&,#1>XTiTRiTi_FPi" "Spec<int,int &, int>::spec(int *)" |
# Fake test -- replace # with % |
test_demangling_exact "hp: spec__13Spec<%1,%1.*>XTiTPi_FPi" "Spec<int,int *>::spec(int *)" |
test_demangling_exact "hp: spec__16Spec<%1,%1.&,%1>XTiTRiTi_FPi" "Spec<int,int &,int>::spec(int *)" |
|
# Global template functions |
|
test_demangling_exact "hp: add__XTc_FcT1" "add<char>(char, char)" |
test_demangling_exact "hp: add__XTcSP9A5label_FcPPlT1" "add<char,9,&label>(char, long **, char)" |
test_demangling_exact "hp: add__XTPfTFPd_f_FcT1" "add<float *,float (double *)>(char, char)" |
|
# Template for template arg |
|
test_demangling_exact "hp: unLink__12basic_stringXTcT18string_char_traitsXTc_T9allocator_Fv" "basic_string<char,string_char_traits<char>,allocator>::unLink(void)" |
|
test_demangling_exact "hp: _Utf390_1__1_9223372036854775807__9223372036854775" \ |
"Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\"" |
} |
|
|
proc catch_demangling_errors {command} { |
if {[catch $command result]} { |
puts "ERROR: demangle.exp: while running $command: $result" |
} |
} |
|
# Test support for different demangling styles. Note that this does |
# not depend upon running the test program and does not depend upon |
# gdb being able to lookup any C++ symbols. It simply calls the |
# internal demangler with synthesized strings and tests the results. |
|
proc do_tests {} { |
global subdir |
global gdb_prompt |
|
|
# Start with a fresh gdb. |
|
gdb_exit |
gdb_start |
|
gdb_test_no_output "set language c++" |
gdb_test_no_output "set width 0" |
|
# Using catch_demangling_errors this way ensures that, if one of |
# the functions raises a Tcl error, then it'll get reported, and |
# the rest of the functions will still run. |
catch_demangling_errors test_lucid_style_demangling |
catch_demangling_errors test_gnu_style_demangling |
catch_demangling_errors test_arm_style_demangling |
catch_demangling_errors test_hp_style_demangling |
} |
|
do_tests |
/rtti.h
0,0 → 1,54
/* Code to go along with tests in rtti.exp. |
|
Copyright 2003, 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
|
Contributed by David Carlton <carlton@bactrian.org> and by Kealia, |
Inc. |
|
This file is part of GDB. |
|
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/>. */ |
|
namespace n2 { |
|
class C2; |
|
class Base2 { |
public: |
virtual ~Base2() { } |
}; |
|
|
class C2: public Base2 { |
public: |
}; |
|
class D2 : public C2{ |
public: |
D2(C2 *, C2 *); |
|
C2* expr_1_; |
C2* expr_2_; |
}; |
|
extern C2 *create2(); |
|
namespace n3 { |
class C3 : public C2 { |
public: |
}; |
} |
|
extern n3::C3 *create3(); |
} |
rtti.h
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: namespace-nested-import.cc
===================================================================
--- namespace-nested-import.cc (nonexistent)
+++ namespace-nested-import.cc (revision 513)
@@ -0,0 +1,12 @@
+namespace A{
+ namespace B{
+ namespace C{
+ int x = 5;
+ }
+ }
+}
+
+int main(){
+ using namespace A::B;
+ return C::x;
+}
Index: ref-types.exp
===================================================================
--- ref-types.exp (nonexistent)
+++ ref-types.exp (revision 513)
@@ -0,0 +1,286 @@
+# Tests for reference types with short type variables in GDB.
+# Copyright 1998, 1999, 2000, 2004, 2007, 2008, 2009, 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 .
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "ref-types"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested ref-types.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1 1"
+
+proc gdb_start_again {} {
+ global srcdir
+ global subdir
+ global binfile
+ global gdb_prompt
+ global decimal
+
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ #
+ # set it up at a breakpoint so we can play with the variable values
+ #
+ if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+ }
+
+ if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+ }
+
+ gdb_test "up" ".*main.*" "up from marker1 2"
+}
+
+
+gdb_test "print s" ".\[0-9\]* = -1" "print value of s"
+gdb_test "ptype s" "type = short"
+
+gdb_test "print *ps" ".\[0-9\]* = -1" "print value of ps"
+gdb_test "ptype ps" "type = short \\*"
+
+gdb_test "print as\[0\]" ".\[0-9\]* = 0" "print value of as\[0\]"
+gdb_test_multiple "ptype as" "ptype as" {
+ -re "type = short \\\[4\\\].*$gdb_prompt $" { pass "ptype as" }
+ -re "type = short int \\\[4\\\].*$gdb_prompt $" { pass "ptype as" }
+}
+
+gdb_test "print as\[1\]" ".\[0-9\]* = 1" "print value of as\[1\]"
+gdb_test "print as\[2\]" ".\[0-9\]* = 2" "print value of as\[2\]"
+gdb_test "print as\[3\]" ".\[0-9\]* = 3" "print value of as\[3\]"
+
+gdb_test_multiple "print rs" "print value of rs" {
+ -re ".\[0-9\]* = \\(short &\\) @$hex: -1.*$gdb_prompt $" {
+ pass "print value of rs"
+ }
+ -re ".\[0-9\]* = \\(short int &\\) @$hex: -1.*$gdb_prompt $" {
+ pass "print value of rs"
+ }
+ eof { fail "print rs ($GDB dumped core) (FIXME)" ; gdb_start_again ; }
+}
+
+gdb_test_multiple "ptype rs" "ptype rs" {
+ -re "type = short &.*$gdb_prompt $" { pass "ptype rs" }
+ -re "type = short int &.*$gdb_prompt $" { pass "ptype rs" }
+}
+
+gdb_test "print *rps" ".\[0-9\]* = -1" "print value of *rps"
+
+# GDB had a bug about dereferencing a pointer type
+# that would lead to wrong results
+# if we try to examine memory at pointer value.
+
+gdb_test "x /hd rps" "$hex:\[ \t\]*-1" "examine value at rps"
+
+gdb_test_multiple "ptype rps" "ptype rps" {
+ -re "type = short \\*&.*$gdb_prompt $" { pass "ptype rps" }
+ -re "type = short int \\*&.*$gdb_prompt $" { pass "ptype rps" }
+}
+
+
+gdb_test "print ras\[0\]" ".\[0-9\]* = 0" "print value of ras\[0\]"
+
+gdb_test_multiple "ptype ras" "ptype ras" {
+ -re "type = short \\\(&\\\)\\\[4\\\].*$gdb_prompt $" { pass "ptype ras" }
+ -re "type = short int \\\(&\\\)\\\[4\\\].*$gdb_prompt $" { pass "ptype ras" }
+}
+
+gdb_test "print ras\[1\]" ".\[0-9\]* = 1" "print value of ras\[1\]"
+gdb_test "print ras\[2\]" ".\[0-9\]* = 2" "print value of ras\[2\]"
+gdb_test "print ras\[3\]" ".\[0-9\]* = 3" "print value of ras\[3\]"
+
+
+if ![runto 'f'] then {
+ perror "couldn't run to f"
+ continue
+}
+
+gdb_test "up" ".main2.*" "up from f"
+
+gdb_test "print C" ".\[0-9\]* = 65 \'A\'" "print value of C"
+gdb_test "ptype C" "type = char"
+
+gdb_test "print UC" ".\[0-9\]* = 21 '\.025'" "print value of UC"
+gdb_test "ptype UC" "type = unsigned char"
+
+gdb_test "print S" ".\[0-9\]* = -14" "print value of S"
+gdb_test "ptype S" "type = short.*"
+
+gdb_test "print US" ".\[0-9\]* = 7" "print value of US"
+gdb_test_multiple "ptype US" "ptype US" {
+ -re "type = unsigned short.*$gdb_prompt $" { pass "ptype US" }
+ -re "type = short unsigned.*$gdb_prompt $" { pass "ptype US" }
+}
+
+gdb_test "print I" ".\[0-9\]* = 102" "print value of I"
+gdb_test "ptype I" "type = int"
+
+gdb_test "print UI" ".\[0-9\]* = 1002" "print value of UI"
+gdb_test "ptype UI" "type = unsigned int"
+
+gdb_test "print L" ".\[0-9\]* = -234" "print value of L"
+gdb_test "ptype L" "type = long.*"
+
+gdb_test "print UL" ".\[0-9\]* = 234" "print value of UL"
+gdb_test_multiple "ptype UL" "ptype UL" {
+ -re "type = unsigned long.*$gdb_prompt $" { pass "ptype UL" }
+ -re "type = long unsigned.*$gdb_prompt $" { pass "ptype UL" }
+}
+
+gdb_test "print F" ".\[0-9\]* = 1.2\[0-9\]*e\\+0?10.*" \
+ "print value of F"
+
+gdb_test "ptype F" "type = float.*"
+
+gdb_test "print D" ".\[0-9\]* = -1.375e-123.*" \
+ "print value of D"
+
+gdb_test "ptype D" "type = double.*"
+
+
+#
+# test reference types
+#
+
+gdb_test "ptype rC" "type = char &"
+
+gdb_test "ptype rUC" "type = unsigned char &"
+
+gdb_test_multiple "ptype rS" "ptype rS" {
+ -re "type = short &.*$gdb_prompt $" { pass "ptype rS" }
+ -re "type = short int &.*$gdb_prompt $" { pass "ptype rS" }
+}
+
+gdb_test_multiple "ptype rUS" "ptype rUS" {
+ -re "type = unsigned short &.*$gdb_prompt $" { pass "ptype rUS" }
+ -re "type = short unsigned int &.*$gdb_prompt $" { pass "ptype rUS" }
+}
+
+gdb_test "ptype rI" "type = int &"
+
+gdb_test "ptype rUI" "type = unsigned int &"
+
+gdb_test_multiple "ptype rL" "ptype rL" {
+ -re "type = long &.*$gdb_prompt $" { pass "ptype rL" }
+ -re "type = long int &.*$gdb_prompt $" { pass "ptype rL" }
+}
+
+gdb_test_multiple "ptype rUL" "ptype rUL" {
+ -re "type = unsigned long &.*$gdb_prompt $" { pass "ptype rUL" }
+ -re "type = long unsigned int &.*$gdb_prompt $" { pass "ptype rUL" }
+}
+
+gdb_test "ptype rF" "type = float &"
+
+gdb_test "ptype rD" "type = double &"
+
+gdb_test "print rC" ".\[0-9\]* = \\(char &\\) @$hex: 65 \'A\'" \
+ "print value of rC"
+
+gdb_test "print rUC" \
+ ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.025\'" \
+ "print value of rUC"
+
+gdb_test_multiple "print rS" "print value of rS" {
+ -re ".\[0-9\]* = \\(short &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+ -re ".\[0-9\]* = \\(short int &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+}
+
+gdb_test_multiple "print rUS" "print value of rUS" {
+ -re ".\[0-9\]* = \\(unsigned short &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+ -re ".\[0-9\]* = \\(short unsigned int &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+}
+
+gdb_test "print rI" ".\[0-9\]* = \\(int &\\) @$hex: 102" \
+ "print value of rI"
+
+gdb_test "print rUI" \
+ ".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002" \
+ "print value of UI"
+
+gdb_test_multiple "print rL" "print value of rL" {
+ -re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+ -re ".\[0-9\]* = \\(long int &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+}
+
+gdb_test_multiple "print rUL" "print value of rUL" {
+ -re ".\[0-9\]* = \\(unsigned long &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+ -re ".\[0-9\]* = \\(long unsigned int &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+}
+
+gdb_test "print rF" \
+ ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+0?10.*" \
+ "print value of rF"
+
+gdb_test "print rD" \
+ ".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*" \
+ "print value of rD"
+
Index: gdb2495.exp
===================================================================
--- gdb2495.exp (nonexistent)
+++ gdb2495.exp (revision 513)
@@ -0,0 +1,166 @@
+# Copyright 2009, 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 .
+
+
+# In gdb inferior function calls, if a C++ exception is raised in the
+# dummy-frame, and the exception handler is (normally, and expected to
+# be) out-of-frame, the default C++ handler will (wrongly) be called
+# in an inferior function call.
+# This is incorrect as an exception can normally and legally be handled
+# out-of-frame. The confines of the dummy frame prevent the unwinder
+# from finding the correct handler (or any handler, unless it is
+# in-frame). The default handler calls std::terminate. This will kill
+# the inferior. Assert that terminate should never be called in an
+# inferior function call. These tests test the functionality around
+# unwinding that sequence and also tests the flag behaviour gating this
+# functionality.
+#
+# PR c++/9600.
+
+# This test is largely based of gdb.base/callfuncs.exp.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+if [target_info exists gdb,nosignals] {
+ verbose "Skipping gdb2495.exp because of nosignals."
+ continue
+}
+
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+set testfile "gdb2495"
+set srcfile ${testfile}.cc
+set binfile $objdir/$subdir/$testfile
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested gdb2495.exp
+ return -1
+}
+
+# Some targets can't do function calls, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to main"
+ continue
+}
+
+# See http://sourceware.org/gdb/bugs/2495
+
+# Test normal baseline behaviour. Call a function that
+# does not raise an exception.
+gdb_test "p exceptions.no_throw_function()" " = 1"
+# And one that does but handles it in-frame.
+gdb_test "p exceptions.throw_function_with_handler()" " = 2"
+# Both should return normally.
+
+# Test basic unwind. Call a function that raises an exception but
+# does not handle it. It should be rewound.
+gdb_test "p exceptions.throw_function()" \
+ "The program being debugged entered a std::terminate call, .*" \
+ "Call a function that raises an exception without a handler."
+
+# Make sure that after rewinding we are back at the call parent.
+gdb_test "bt" \
+ "#0 main.*" \
+ "bt after returning from a popped frame"
+
+# Make sure the only breakpoint is the one set via the runto_main
+# call and that the std::terminate breakpoint has evaporated and
+# cleaned-up.
+gdb_test "info breakpoints" \
+ "gdb.cp/gdb2495\.cc.*"
+
+# Turn off this new behaviour.
+gdb_test_multiple "set unwind-on-terminating-exception off" \
+ "Turn unwind-on-terminating-exception off" {
+ -re "$gdb_prompt $" {pass "set unwinn-on-terminating-exception off"}
+ timeout {fail "(timeout) set unwind-on-terminating-exception off"}
+}
+
+# Check that it is turned off.
+gdb_test "show unwind-on-terminating-exception" \
+ "exception is unhandled while in a call dummy is off.*" \
+ "Turn off unwind on terminating exception flag"
+
+# Check that the old behaviour is restored.
+gdb_test "p exceptions.throw_function()" \
+ "The program being debugged was signaled while in a function called .*" \
+ "Call a function that raises an exception with unwinding off.."
+
+# Restart the inferior back at main.
+if ![runto_main] then {
+ perror "couldn't run to main"
+ continue
+}
+
+
+# Check to see if the new behaviour alters the unwind signal
+# behaviour; it should not. Test both on and off states.
+
+# Turn on unwind on signal behaviour.
+gdb_test_multiple "set unwindonsignal on" "Turn unwindonsignal on" {
+ -re "$gdb_prompt $" {pass "set unwindonsignal on"}
+ timeout {fail "(timeout) set unwindonsignal on"}
+}
+
+# Check that it is turned on.
+gdb_test "show unwindonsignal" \
+ "signal is received while in a call dummy is on.*" \
+ "Turn on unwind on signal"
+
+# Check to see if new behaviour interferes with
+# normal signal handling in inferior function calls.
+gdb_test "p exceptions.raise_signal(1)" \
+ "To change this behavior use \"set unwindonsignal off\".*"
+
+# And reverse - turn off again.
+gdb_test_multiple "set unwindonsignal off" "Turn unwindonsignal off" {
+ -re "$gdb_prompt $" {pass "set unwindonsignal off"}
+ timeout {fail "(timeout) set unwindonsignal off"}
+}
+
+# Check that it is actually turned off.
+gdb_test "show unwindonsignal" \
+ "signal is received while in a call dummy is off.*" \
+ "Turn off unwind on signal"
+
+# Check to see if new behaviour interferes with
+# normal signal handling in inferior function calls.
+gdb_test "p exceptions.raise_signal(1)" \
+ "To change this behavior use \"set unwindonsignal on\".*"
Index: pr10728-x.cc
===================================================================
--- pr10728-x.cc (nonexistent)
+++ pr10728-x.cc (revision 513)
@@ -0,0 +1,7 @@
+#include "pr10728-x.h"
+
+int main()
+{
+ X* x = y();
+ return 0; // marker 1
+}
Index: pr-574.cc
===================================================================
--- pr-574.cc (nonexistent)
+++ pr-574.cc (revision 513)
@@ -0,0 +1,40 @@
+/* This test script is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2004, 2007, 2008, 2009, 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 .
+ */
+
+/*
+ An attempt to replicate PR gdb/574 with a shorter program.
+
+ Printing out *theB failed if the program was compiled with GCC 2.95.
+*/
+
+class A {
+public:
+ virtual void foo() {}; // Stick in a virtual function.
+ int a; // Stick in a data member.
+};
+
+class B : public A {
+ static int b; // Stick in a static data member.
+};
+
+int main()
+{
+ B *theB = new B;
+
+ return 0; // breakpoint: constructs-done
+}
Index: pr10687.exp
===================================================================
--- pr10687.exp (nonexistent)
+++ pr10687.exp (revision 513)
@@ -0,0 +1,31 @@
+#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 .
+
+set testfile pr10687
+set srcfile ${testfile}.cc
+if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] {
+ return -1
+}
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return
+}
+
+gdb_breakpoint [gdb_get_line_number "marker"]
+gdb_continue_to_breakpoint "marker"
+
+gdb_test "p a" "{static axis = {{static axis = .
+ */
+
+// Pls try the following program on virtual functions and try to do print on
+// most of the code in main(). Almost none of them works !
+
+//
+// The inheritance structure is:
+//
+// V : VA VB
+// A : (V)
+// B : A
+// D : AD (V)
+// C : (V)
+// E : B (V) D C
+//
+
+class VA
+{
+public:
+ int va;
+};
+
+class VB
+{
+public:
+ int vb;
+ int fvb();
+ virtual int vvb();
+};
+
+class V : public VA, public VB
+{
+public:
+ int f();
+ virtual int vv();
+ int w;
+};
+
+class A : virtual public V
+{
+public:
+ virtual int f();
+private:
+ int a;
+};
+
+class B : public A
+{
+public:
+ int f();
+private:
+ int b;
+};
+
+class C : public virtual V
+{
+public:
+ int c;
+};
+
+class AD
+{
+public:
+ virtual int vg() = 0;
+};
+
+class D : public AD, virtual public V
+{
+public:
+ static void s();
+ virtual int vg();
+ virtual int vd();
+ int fd();
+ int d;
+};
+
+class E : public B, virtual public V, public D, public C
+{
+public:
+ int f();
+ int vg();
+ int vv();
+ int e;
+};
+
+D dd;
+D* ppd = ⅆ
+AD* pAd = ⅆ
+
+A a;
+B b;
+C c;
+D d;
+E e;
+V v;
+VB vb;
+
+
+A* pAa = &a;
+A* pAe = &e;
+
+B* pBe = &e;
+
+D* pDd = &d;
+D* pDe = &e;
+
+V* pVa = &a;
+V* pVv = &v;
+V* pVe = &e;
+V* pVd = &d;
+
+AD* pADe = &e;
+
+E* pEe = &e;
+
+VB* pVB = &vb;
+
+void init()
+{
+ a.vb = 1;
+ b.vb = 2;
+ c.vb = 3;
+ d.vb = 4;
+ e.vb = 5;
+ v.vb = 6;
+ vb.vb = 7;
+
+ d.d = 1;
+ e.d = 2;
+}
+
+extern "C" int printf(const char *, ...);
+
+int all_count = 0;
+int failed_count = 0;
+
+#define TEST(EXPR, EXPECTED) \
+ ret = EXPR; \
+ if (ret != EXPECTED) {\
+ printf("Failed %s is %d, should be %d!\n", #EXPR, ret, EXPECTED); \
+ failed_count++; } \
+ all_count++;
+
+int ret;
+
+void test_calls()
+{
+ TEST(pAe->f(), 20);
+ TEST(pAa->f(), 1);
+
+ TEST(pDe->vg(), 202);
+ TEST(pADe->vg(), 202);
+ TEST(pDd->vg(), 101);
+
+ TEST(pEe->vvb(), 411);
+
+ TEST(pVB->vvb(), 407);
+
+ TEST(pBe->vvb(), 411);
+ TEST(pDe->vvb(), 411);
+
+ TEST(pEe->vd(), 282);
+ TEST(pEe->fvb(), 311);
+
+ TEST(pEe->D::vg(), 102);
+ printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
+}
+#ifdef usestubs
+extern "C" {
+ void set_debug_traps();
+ void breakpoint();
+};
+#endif
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ init();
+
+ e.w = 7;
+ e.vb = 11;
+
+ test_calls();
+ return 0;
+
+}
+
+int A::f() {return 1;}
+int B::f() {return 2;}
+void D::s() {}
+int E::f() {return 20;}
+int D::vg() {return 100+d;}
+int E::vg() {return 200+d;}
+int V::f() {return 600+w;}
+int V::vv() {return 400+w;}
+int E::vv() {return 450+w;}
+int D::fd() {return 250+d;}
+int D::vd() {return 280+d;}
+int VB::fvb() {return 300+vb;}
+int VB::vvb() {return 400+vb;}
Index: static-print-quit.cc
===================================================================
--- static-print-quit.cc (nonexistent)
+++ static-print-quit.cc (revision 513)
@@ -0,0 +1,32 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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 . */
+
+class D
+ {
+ public:
+ int loooooooooooooooooooooooooooooooooooooooooooooong;
+ };
+
+class C
+ {
+ public:
+ int loooooooooooooooooooooooooooooooooooooooooooooong;
+ static D field;
+ };
+
+D C::field;
+C c;
Index: misc.exp
===================================================================
--- misc.exp (nonexistent)
+++ misc.exp (revision 513)
@@ -0,0 +1,130 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2002, 2007, 2008, 2009, 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 .
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "misc"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested misc.exp
+ return -1
+}
+
+#
+# Deduce language of main()
+#
+
+proc deduce_language_of_main {} {
+ global gdb_prompt
+
+ # See what language gdb thinks main() is, prior to reading full symbols.
+ # I think this fails for COFF targets.
+ gdb_test "show language" \
+ "source language is \"auto; currently c\[+\]+\".*" \
+ "deduced language is C++, before full symbols"
+
+ runto_main
+
+ # See if our idea of the language has changed.
+
+ gdb_test "show language" \
+ "source language is \"auto; currently c\[+\]+\".*" \
+ "deduced language is C++, after full symbols"
+}
+
+proc test_expr { args } {
+ if { [llength $args] % 2 } {
+ warning "an even # of arguments should be passed to test_expr"
+ }
+ set last_ent [expr [llength $args] - 1];
+ set testname [lindex $args $last_ent];
+ if [gdb_test_no_output [lindex $args 0] "$testname (setup)"] {
+ gdb_suppress_tests;
+ }
+ for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
+ if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
+ gdb_suppress_tests;
+ }
+ }
+ gdb_stop_suppressing_tests;
+}
+
+proc do_tests {} {
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ deduce_language_of_main
+ # Check for fixes for PRs 8916 and 8630
+ gdb_test "print s.a" ".* = 0" "print s.a for foo struct (known gcc 2.7.2 and earlier bug)"
+}
+
+do_tests
+
+test_expr "set language c++" \
+ "print 1 == 1" "print.*\\$\[0-9\]* = true" \
+ "print 1 == 2" "print.*\\$\[0-9\]* = false" \
+ "print as bool"
+
+# Test bool type printing, etc.
+# Note: Language is already set to C++ above!
+gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var"
+
+# set a bool variable
+test_expr "set variable v_bool = true" \
+ "print v_bool" "\\$\[0-9\]* = true" \
+ "set a bool var"
+
+# next print an array of bool
+gdb_test "print v_bool_array" "\\$\[0-9\]* = \\{false, false\\}" "print a bool array"
+
+# set elements of a bool array
+test_expr "set variable v_bool_array\[1\] = true" \
+ "print v_bool_array" "\\$\[0-9\]* = \\{false, true\\}" \
+ "set a bool array elem"
+
+# bool constants
+gdb_test "print true" "\\$\[0-9\]* = true" "print true"
+gdb_test "print false" "\\$\[0-9\]* = false" "print false"
+
+# arithmetic conversions
+gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true"
+gdb_test "print 3 + false" "\\$\[0-9\]* = 3" "3 + false"
+gdb_test "print 1 < 2 < 3" "\\$\[0-9\]* = true" "1 < 2 < 3"
+gdb_test "print 2 < 1 > 4" "\\$\[0-9\]* = false" "2 < 1 > 4"
+gdb_test "print (bool)43" "\\$\[0-9\]* = true" "(bool)43"
+gdb_test "print (bool)0" "\\$\[0-9\]* = false" "(bool)0"
+gdb_test "print (bool)17.93" "\\$\[0-9\]* = true" "(bool)17.93"
+gdb_test "print (bool)0.0" "\\$\[0-9\]* = false" "(bool)0.0"
+gdb_test "print (int)true" "\\$\[0-9\]* = 1" "(int)true"
+gdb_test "print (int)false" "\\$\[0-9\]* = 0" "(int)false"
Index: printmethod.exp
===================================================================
--- printmethod.exp (nonexistent)
+++ printmethod.exp (revision 513)
@@ -0,0 +1,72 @@
+# Copyright 2002, 2003, 2005, 2006, 2007, 2008, 2009, 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 .
+
+# This tries to print out methods of classes.
+
+# 2002-08-16 David Carlton
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+
+set testfile "printmethod"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested printmethod.exp
+ return -1
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# First, run to after we've constructed the object:
+
+gdb_breakpoint [gdb_get_line_number "constructs-done"]
+gdb_continue_to_breakpoint "end of constructors"
+
+# The first of these is for PR gdb/653.
+
+gdb_test "print theA->virt" \
+ "\\$\[0-9\]* = {void \\(A \\*\\)} $hex " \
+ "print virtual method."
+gdb_test "print theA->nonvirt" \
+ "\\$\[0-9\]* = {void \\(A \\*\\)} $hex " \
+ "print nonvirtual method."
+
+gdb_exit
+return 0
Index: pr-574.exp
===================================================================
--- pr-574.exp (nonexistent)
+++ pr-574.exp (revision 513)
@@ -0,0 +1,70 @@
+# Copyright 2002, 2007, 2008, 2009, 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 .
+
+# Tests for the bug mentioned in PR gdb/574. It's a bit
+# idiosyncratic, so I gave it its own file.
+
+# 2002-08-16 David Carlton
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+
+set testfile "pr-574"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested pr-574.exp
+ return -1
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# First, run to after we've constructed the object:
+
+gdb_breakpoint [gdb_get_line_number "constructs-done"]
+gdb_continue_to_breakpoint "end of constructors"
+
+# This failed, as long as the code was compiled with GCC v. 2.
+
+# Different compilers order the data for differently, so I'm not
+# matching the result exactly.
+
+gdb_test "print *theB" "\\$\[0-9\]* = { = {\[^}\]*}, static b = }" "PR gdb/574"
+
+gdb_exit
+return 0
Index: ovldbreak.cc
===================================================================
--- ovldbreak.cc (nonexistent)
+++ ovldbreak.cc (revision 513)
@@ -0,0 +1,184 @@
+#include
+
+class foo {
+public:
+ foo (int);
+ foo (int, const char *);
+ foo (foo&);
+ ~foo ();
+ void foofunc (int);
+ void foofunc (int, signed char *);
+ int ifoo;
+ const char *ccpfoo;
+
+int overload1arg (void);
+int overload1arg (char);
+int overload1arg (signed char);
+int overload1arg (unsigned char);
+int overload1arg (short);
+int overload1arg (unsigned short);
+int overload1arg (int);
+int overload1arg (unsigned int);
+int overload1arg (long);
+int overload1arg (unsigned long);
+int overload1arg (float);
+int overload1arg (double);
+
+int overloadargs (int a1);
+int overloadargs (int a1, int a2);
+int overloadargs (int a1, int a2, int a3);
+int overloadargs (int a1, int a2, int a3, int a4);
+int overloadargs (int a1, int a2, int a3, int a4, int a5);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11);
+
+
+};
+
+void marker1()
+{}
+
+int main ()
+{
+ char arg2 = 2;
+ signed char arg3 =3;
+ unsigned char arg4 =4;
+ short arg5 =5;
+ unsigned short arg6 =6;
+ int arg7 =7;
+ unsigned int arg8 =8;
+ long arg9 =9;
+ unsigned long arg10 =10;
+ float arg11 =100.0;
+ double arg12 = 200.0;
+
+ char ch='A';
+ foo foo_instance1(111);
+ foo foo_instance2(222, &ch);
+ foo foo_instance3(foo_instance2);
+
+ foo_instance1.overload1arg();
+ foo_instance1.overload1arg(arg2);
+ foo_instance1.overload1arg(arg3);
+ foo_instance1.overload1arg(arg4);
+ foo_instance1.overload1arg(arg5);
+ foo_instance1.overload1arg(arg6);
+ foo_instance1.overload1arg(arg7);
+ foo_instance1.overload1arg(arg8);
+ foo_instance1.overload1arg(arg9);
+ foo_instance1.overload1arg(arg10);
+ foo_instance1.overload1arg(arg11);
+ foo_instance1.overload1arg(arg12);
+
+ foo_instance1.overloadargs(1);
+ foo_instance1.overloadargs(1, 2);
+ foo_instance1.overloadargs(1, 2, 3);
+ foo_instance1.overloadargs(1, 2, 3, 4);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+
+ marker1();
+ return 0;
+}
+
+foo::foo (int i) { ifoo = i;}
+foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
+foo::foo (foo& afoo) { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;}
+foo::~foo () {}
+
+
+/* Some functions to test overloading by varying one argument type. */
+
+int foo::overload1arg (void) { return 1; }
+int foo::overload1arg (char arg) { arg = 0; return 2;}
+int foo::overload1arg (signed char arg) { arg = 0; return 3;}
+int foo::overload1arg (unsigned char arg) { arg = 0; return 4;}
+int foo::overload1arg (short arg) { arg = 0; return 5;}
+int foo::overload1arg (unsigned short arg) { arg = 0; return 6;}
+int foo::overload1arg (int arg) { arg = 0; return 7;}
+int foo::overload1arg (unsigned int arg) { arg = 0; return 8;}
+int foo::overload1arg (long arg) { arg = 0; return 9;}
+int foo::overload1arg (unsigned long arg) { arg = 0; return 10;}
+int foo::overload1arg (float arg) { arg = 0; return 11;}
+int foo::overload1arg (double arg) { arg = 0; return 12;}
+
+
+/* Some functions to test overloading by varying argument count. */
+
+int foo::overloadargs (int a1)
+{ a1 = 0;
+return 1;}
+
+int foo::overloadargs (int a1, int a2)
+{ a1 = a2 = 0;
+return 2;}
+
+int foo::overloadargs (int a1, int a2, int a3)
+{ a1 = a2 = a3 = 0;
+return 3;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4)
+{ a1 = a2 = a3 = a4 = 0;
+return 4;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
+{ a1 = a2 = a3 = a4 = a5 = 0;
+return 5;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
+{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
+return 6;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
+return 7;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
+return 8;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9)
+{
+ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
+ return 9;
+}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; return 10;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 = 0; return 11;}
+
+
+void foo::foofunc (int a)
+{
+}
+
+void foo::foofunc (int b, signed char *c)
+{
+}
+
Index: mb-ctor.exp
===================================================================
--- mb-ctor.exp (nonexistent)
+++ mb-ctor.exp (revision 513)
@@ -0,0 +1,87 @@
+# Copyright 2007, 2008, 2009, 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 .
+
+# Test that breakpoints on C++ constructors work, despite the
+# fact that gcc generates several versions of constructor function.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+
+set testfile "mb-ctor"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested mb-ctor.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Set a breakpoint with multiple locations
+# and a condition.
+
+gdb_test "break 'Derived::Derived(int)'" \
+ "Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
+ "set-breakpoint at ctor"
+
+gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
+
+gdb_test "break 'Derived::~Derived()'" \
+ "Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
+ "set-breakpoint at dtor"
+
+gdb_test "continue" \
+ ".*Breakpoint.*Derived.*i=7.*" \
+ "run to breakpoint 1 v1"
+
+gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here"
+
+gdb_test "continue" \
+ ".*Breakpoint.*Derived.*i=15.*" \
+ "run to breakpoint 1 v2"
+
+gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here"
+
+gdb_test "continue" \
+ ".*Breakpoint.*~Derived.*" \
+ "run to breakpoint 3 v1"
+
+gdb_test "continue" \
+ ".*Breakpoint.*~Derived.*" \
+ "run to breakpoint 3 v2"
+
+gdb_test "continue" \
+ ".*exited normally.*" \
+ "run to exit"
+
+
+
Index: mb-inline.h
===================================================================
--- mb-inline.h (nonexistent)
+++ mb-inline.h (revision 513)
@@ -0,0 +1,37 @@
+/* Test gdb support for setting multiple file:line breakpoints on static
+ functions. In practice the functions may be inline fns compiled with -O0.
+ We avoid using inline here for simplicity's sake.
+
+ This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008, 2009, 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 .
+ */
+
+static int
+foo (int i)
+{
+ return i; // set breakpoint here
+}
+
+static int
+multi_line_foo (int i)
+{
+ return // set multi-line breakpoint here
+ i;
+}
+
+extern int afn ();
+extern int bfn ();
mb-inline.h
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr9594.cc
===================================================================
--- pr9594.cc (nonexistent)
+++ pr9594.cc (revision 513)
@@ -0,0 +1,52 @@
+
+class Base
+{
+public:
+ virtual int get_foo () { return 1; }
+ int base_function_only () { return 2; }
+};
+
+class Foo : public Base
+{
+
+private:
+ int foo_value;
+
+public:
+ Foo () { foo_value = 0;}
+ Foo (int i) { foo_value = i;}
+ ~Foo () { }
+ void set_foo (int value);
+ int get_foo ();
+
+ // Something similar to a constructor name.
+ void Foofoo ();
+
+ bool operator== (const Foo &other) { return foo_value == other.foo_value; }
+};
+
+void Foo::set_foo (int value)
+{
+ foo_value = value;
+}
+
+int Foo::get_foo ()
+{
+ return foo_value;
+}
+
+void Foo::Foofoo ()
+{
+}
+
+int main ()
+{
+ // Anonymous struct with method.
+ struct {
+ int get() { return 5; }
+ } a;
+ Foo foo1;
+ foo1.set_foo (42); // Set breakpoint here.
+ a.get(); // Prevent compiler from throwing 'a' away.
+ return 0;
+}
Index: m-static.cc
===================================================================
--- m-static.cc (nonexistent)
+++ m-static.cc (revision 513)
@@ -0,0 +1,83 @@
+// 2002-05-13
+
+enum region { oriental, egyptian, greek, etruscan, roman };
+
+// Test one.
+class gnu_obj_1
+{
+protected:
+ typedef region antiquities;
+ static const bool test = true;
+ static const int key1 = 5;
+ static long key2;
+
+ static antiquities value;
+
+public:
+ gnu_obj_1(antiquities a, long l) {}
+
+ long method ()
+ {
+ static bool svar = true;
+ return key2;
+ }
+};
+
+const bool gnu_obj_1::test;
+const int gnu_obj_1::key1;
+long gnu_obj_1::key2 = 77;
+gnu_obj_1::antiquities gnu_obj_1::value = oriental;
+
+
+// Test two.
+template
+class gnu_obj_2: public virtual gnu_obj_1
+{
+public:
+ static antiquities value_derived;
+
+public:
+ gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7) { }
+};
+
+template
+typename gnu_obj_2::antiquities gnu_obj_2::value_derived = etruscan;
+
+// Test three.
+template
+class gnu_obj_3
+{
+public:
+ typedef region antiquities;
+ static gnu_obj_2 data;
+
+public:
+ gnu_obj_3(antiquities b) { }
+};
+
+template
+gnu_obj_2 gnu_obj_3::data(etruscan);
+
+// 2002-08-16
+// Test four.
+#include "m-static.h"
+
+// instantiate templates explicitly so their static members will exist
+template class gnu_obj_2;
+template class gnu_obj_2;
+template class gnu_obj_3;
+
+int main()
+{
+ gnu_obj_1 test1(egyptian, 4589);
+ gnu_obj_2 test2(roman);
+ gnu_obj_3 test3(greek);
+ gnu_obj_4 test4;
+
+ test4.dummy = test4.elsewhere;
+ test4.dummy = 0;
+
+ test1.method (); // breakpoint: constructs-done
+
+ return test4.dummy;
+}
Index: re-set-overloaded.cc
===================================================================
--- re-set-overloaded.cc (nonexistent)
+++ re-set-overloaded.cc (revision 513)
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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 . */
+
+class C
+ {
+ public:
+ C() {}
+ C(int x) {}
+ };
+
+C a;
+C b(1);
Index: virtfunc2.cc
===================================================================
--- virtfunc2.cc (nonexistent)
+++ virtfunc2.cc (revision 513)
@@ -0,0 +1,39 @@
+ /* This test script is part of GDB, the GNU debugger.
+
+ Copyright 2009, 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 .
+ */
+
+class interface
+{
+ virtual int do_print3() { return 111111; }
+};
+
+class Obj : virtual public interface
+{
+public:
+ virtual int do_print() { return 123456; }
+};
+
+class Obj2 : Obj, virtual public interface
+{
+ virtual int do_print2() { return 654321; }
+};
+
+int main(int argc, char** argv) {
+ Obj o;
+ Obj2 o2;
+ return 0; // marker 1
+}
Index: casts.exp
===================================================================
--- casts.exp (nonexistent)
+++ casts.exp (revision 513)
@@ -0,0 +1,170 @@
+# Copyright 2002, 2003, 2004, 2007, 2008, 2009, 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 .
+
+# This file is part of the gdb testsuite
+
+# Test casting, especially between class types or pointer-to-class
+# types.
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "casts"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested casts.exp
+ return -1
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \
+ "Breakpoint.*at.* file .*" \
+ ""
+
+gdb_test "continue" "Breakpoint .* at .*casts.cc.*" ""
+
+# Casting a pointer to a base class to a pointer to a derived class
+# should yield the entire derived class. Until August 2002, GDB got
+# the enclosing type on `(B *) a' wrong: while the value's static type
+# was `B *', as it should be, the enclosing type (which is supposed to
+# be the dynamic type) was `A *'. It's senseless to have a static
+# type derived from the dynamic type; it should be the other way
+# 'round. Dereferencing this oddly typed pointer yielded a value in
+# which only the base class's members were initialized, since GDB uses
+# the enclosing type to decide how many bytes to read. Members from
+# the derived class were garbage, from GDB's address space.
+gdb_test "print * (B *) a" ".* = { = {a = 42}, b = 1729}" \
+ "cast base class pointer to derived class pointer"
+
+# Check also that we get the same results from letting the compiler do
+# the dereference.
+gdb_test "print * b" ".* = { = {a = 42}, b = 1729}" \
+ "let compiler cast base class pointer to derived class pointer"
+
+# Check upcasting (it is trivial but still).
+gdb_test "print * (A *) b" ".* = {a = 42}" \
+ "cast derived class pointer to base class pointer"
+
+# Casting References.
+# Check upcasting.
+gdb_test "print (A &) br" ".* = .A &.* {a = 42}" \
+ "cast derived class reference to base class reference"
+
+# Check downcasting.
+gdb_test "print (B &) ar" ".* = .B.* { = {a = 42}, b = 1729}" \
+ "cast base class reference to derived class reference"
+
+# Check compiler casting
+gdb_test "print br" ".* = .B.* { = {a = 42}, b = 1729}" \
+ "let compiler cast base class reference to derived class reference"
+
+
+# A few basic tests of "new" casts.
+
+gdb_test "print const_cast (b)" " = \\(const B \\*\\) $hex" \
+ "basic test of const_cast"
+
+gdb_test "print const_cast (0)" " = \\(void \\*\\) 0x0" \
+ "const_cast of 0"
+
+gdb_test "print static_cast (b)" " = \\(A \\*\\) $hex" \
+ "basic test of static_cast"
+
+gdb_test "print static_cast (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \
+ "static_cast to reference type"
+
+gdb_test "print reinterpret_cast (b)" " = \\(A \\*\\) $hex" \
+ "basic test of reinterpret_cast"
+
+gdb_test "print reinterpret_cast (b)" "Invalid reinterpret_cast" \
+ "test invalid reinterpret_cast"
+
+gdb_test "print reinterpret_cast (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \
+ "reinterpret_cast to reference type"
+
+# Tests of dynamic_cast.
+
+set nonzero_hex "0x\[0-9A-Fa-f\]\[0-9A-Fa-f\]+"
+
+gdb_test "print dynamic_cast (a)" \
+ ".*must be a pointer or reference type" \
+ "invalid dynamic_cast"
+
+gdb_test "print dynamic_cast (0)" \
+ " = \\(void \\*\\) 0x0" \
+ "dynamic_cast of 0 to void*"
+
+gdb_test "print dynamic_cast (&derived)" \
+ " = \\(Alpha \\*\\) $nonzero_hex" \
+ "dynamic_cast simple upcast"
+
+gdb_test "print dynamic_cast (&doublyderived)" \
+ " = \\(Alpha \\*\\) $nonzero_hex" \
+ "dynamic_cast upcast to unique base"
+
+gdb_test "print dynamic_cast (derived)" \
+ " = \\(Alpha \\&\\) @$nonzero_hex: {.* = $nonzero_hex}" \
+ "dynamic_cast simple upcast to reference"
+
+gdb_test "print dynamic_cast (ad)" \
+ " = \\(Derived \\*\\) $nonzero_hex" \
+ "dynamic_cast simple downcast"
+
+gdb_test "print dynamic_cast (add)" \
+ " = \\(VirtuallyDerived \\*\\) $nonzero_hex" \
+ "dynamic_cast simple downcast to intermediate class"
+
+gdb_test "print dynamic_cast (ad)" \
+ " = \\(VirtuallyDerived \\*\\) 0x0" \
+ "dynamic_cast to non-existing base"
+
+gdb_test "print dynamic_cast (*ad)" \
+ "dynamic_cast failed" \
+ "dynamic_cast to reference to non-existing base"
+
+gdb_test "print dynamic_cast (add)" \
+ " = \\(DoublyDerived \\*\\) $nonzero_hex" \
+ "dynamic_cast unique downcast"
+
+gdb_test "print dynamic_cast (add)" \
+ " = \\(Gamma \\*\\) $nonzero_hex" \
+ "dynamic_cast to sibling"
Index: gdb2384.exp
===================================================================
--- gdb2384.exp (nonexistent)
+++ gdb2384.exp (revision 513)
@@ -0,0 +1,94 @@
+# Copyright 2007, 2009, 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 .
+
+# When gdb resolves type information for class "derived" from objfile
+# gdb2384, it use to fill in the TYPE_VPTR_BASETYPE field with class "base"
+# from objfile gdb2384-base.so. When the program is rerun the type
+# information for base-in-so-base.so is discarded leaving
+# TYPE_VPTR_BASETYPE dangling.
+#
+# PR c++/9489.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+if { [skip_shlib_tests] } { continue }
+
+set testfile "gdb2384"
+set srcfile ${testfile}.cc
+set binfile $objdir/$subdir/$testfile
+
+set libfile "gdb2384-base"
+set libsrcfile ${libfile}.cc
+set sofile $objdir/$subdir/${libfile}.so
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++}] != ""
+ || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
+ untested gdb2384.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+gdb_load_shlibs ${sofile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ return -1
+}
+
+gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
+gdb_continue_to_breakpoint "set breakpoint here"
+
+gdb_test "print d1.meth ()" \
+ ".*42.*" \
+ "print d1.meth ()"
+
+# Now try again. gdb's without the fix will hopefully segv here
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
+gdb_continue_to_breakpoint "set breakpoint here"
+gdb_test "print d1.meth ()" \
+ ".*42.*" \
+ "gdb2384"
+
+# second case
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
+gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_test "print d2.meth ()" \
+ ".*24.*" \
+ "print d2.meth()"
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
+gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_test "print d2.meth ()" \
+ ".*24.*" \
+ "gdb2384 (second)"
+
Index: operator.cc
===================================================================
--- operator.cc (nonexistent)
+++ operator.cc (revision 513)
@@ -0,0 +1,211 @@
+class A
+{
+};
+
+int operator== (A, int)
+{
+ return 11;
+}
+
+int operator== (A, char)
+{
+ return 12;
+}
+
+//------------------
+
+namespace B
+{
+ class C
+ {
+ };
+
+ int operator== (C, int)
+ {
+ return 22;
+ }
+
+ int operator== (C, char)
+ {
+ return 23;
+ }
+
+ namespace BD
+ {
+ int operator== (C, int)
+ {
+ return 24;
+ }
+ }
+}
+
+//------------------
+
+class D
+{
+};
+namespace
+{
+ int operator== (D, int)
+ {
+ return 33;
+ }
+
+ int operator== (D, char)
+ {
+ return 34;
+ }
+}
+
+int operator== (D, float)
+{
+ return 35;
+}
+
+//------------------
+
+class E
+{
+};
+namespace F
+{
+ int operator== (E, int)
+ {
+ return 44;
+ }
+
+ int operator== (E, char)
+ {
+ return 45;
+ }
+}
+
+int operator== (E, float)
+{
+ return 46;
+}
+
+using namespace F;
+
+//-----------------
+
+class G
+{
+public:
+ int operator== (int)
+ {
+ return 55;
+ }
+};
+
+int operator== (G, char)
+{
+ return 56;
+}
+
+//------------------
+
+class H
+{
+};
+namespace I
+{
+ int operator== (H, int)
+ {
+ return 66;
+ }
+}
+
+namespace ALIAS = I;
+
+//------------------
+
+class J
+{
+};
+
+namespace K
+{
+ int i;
+ int operator== (J, int)
+ {
+ return 77;
+ }
+}
+
+using K::i;
+
+//------------------
+
+class L
+{
+};
+namespace M
+{
+ int operator== (L, int)
+ {
+ return 88;
+ }
+}
+
+namespace N
+{
+ using namespace M;
+}
+
+using namespace N;
+
+//------------------
+
+namespace O
+{
+ namespace P
+ {
+ using namespace ::O;
+ }
+ using namespace P;
+}
+
+using namespace O;
+
+class test { };
+test x;
+
+//------------------
+
+int main ()
+{
+ A a;
+ a == 1;
+ a == 'a';
+
+ B::C bc;
+ bc == 1;
+ bc == 'a';
+ B::BD::operator== (bc,'a');
+
+ D d;
+ d == 1;
+ d == 'a';
+ d == 1.0f;
+
+ E e;
+ e == 1;
+ e == 'a';
+ e == 1.0f;
+
+ G g;
+ g == 1;
+ g == 'a';
+
+ H h;
+ I::operator== (h, 1);
+
+ J j;
+ K::operator== (j, 1);
+
+ L l;
+ l == 1;
+
+ return 0;
+}
Index: namespace.cc
===================================================================
--- namespace.cc (nonexistent)
+++ namespace.cc (revision 513)
@@ -0,0 +1,209 @@
+namespace AAA {
+ char c;
+ int i;
+ int A_xyzq (int);
+ char xyzq (char);
+ class inA {
+ public:
+ int xx;
+ int fum (int);
+ };
+ enum SomeEnum {
+ ALPHA,
+ BETA,
+ DELTA
+ };
+};
+
+int AAA::inA::fum (int i)
+{
+ return 10 + i;
+}
+
+namespace BBB {
+ char c;
+ int i;
+ int B_xyzq (int);
+ char xyzq (char);
+
+ namespace CCC {
+ char xyzq (char);
+ };
+
+ class Class {
+ public:
+ char xyzq (char);
+ int dummy;
+ };
+};
+
+int AAA::A_xyzq (int x)
+{
+ return 2 * x;
+}
+
+char AAA::xyzq (char c)
+{
+ return 'a';
+}
+
+
+int BBB::B_xyzq (int x)
+{
+ return 3 * x;
+}
+
+char BBB::xyzq (char c)
+{
+ return 'b';
+}
+
+char BBB::CCC::xyzq (char c)
+{
+ return 'z';
+}
+
+char BBB::Class::xyzq (char c)
+{
+ return 'o';
+}
+
+void marker1(void)
+{
+ return;
+}
+
+namespace
+{
+ int X = 9;
+
+ namespace G
+ {
+ int Xg = 10;
+
+ namespace
+ {
+ int XgX = 11;
+ }
+ }
+}
+
+namespace C
+{
+ int c = 1;
+ int shadow = 12;
+
+ class CClass {
+ public:
+ int x;
+ class NestedClass {
+ public:
+ int y;
+ };
+ };
+
+ void ensureRefs () {
+ // NOTE (2004-04-23, carlton): This function is here only to make
+ // sure that GCC 3.4 outputs debug info for these classes.
+ static CClass *c = new CClass();
+ static CClass::NestedClass *n = new CClass::NestedClass();
+ }
+
+ namespace
+ {
+ int cX = 6;
+
+ namespace F
+ {
+ int cXf = 7;
+
+ namespace
+ {
+ int cXfX = 8;
+ }
+ }
+ }
+
+ namespace C
+ {
+ int cc = 2;
+ }
+
+ namespace E
+ {
+ int ce = 4;
+ }
+
+ namespace D
+ {
+ int cd = 3;
+ int shadow = 13;
+
+ namespace E
+ {
+ int cde = 5;
+ }
+
+ void marker2 (void)
+ {
+ // NOTE: carlton/2003-04-23: I'm listing the expressions that I
+ // plan to have GDB try to print out, just to make sure that the
+ // compiler and I agree which ones should be legal! It's easy
+ // to screw up when testing the boundaries of namespace stuff.
+ c;
+ //cc;
+ C::cc;
+ cd;
+ //C::D::cd;
+ E::cde;
+ shadow;
+ //E::ce;
+ cX;
+ F::cXf;
+ F::cXfX;
+ X;
+ G::Xg;
+ //cXOtherFile;
+ //XOtherFile;
+ G::XgX;
+
+ return;
+ }
+
+ }
+}
+
+extern int ensureOtherRefs ();
+
+int main ()
+{
+ using AAA::inA;
+ char c1;
+ AAA::SomeEnum var = AAA::ALPHA;
+
+ using namespace BBB;
+
+ c1 = xyzq ('x');
+ c1 = AAA::xyzq ('x');
+ c1 = BBB::CCC::xyzq ('m');
+
+ inA ina;
+
+ ina.xx = 33;
+
+ int y;
+
+ y = AAA::A_xyzq (33);
+ y += B_xyzq (44);
+
+ BBB::Class cl;
+
+ c1 = cl.xyzq('e');
+
+ marker1();
+
+ C::D::marker2 ();
+
+ C::ensureRefs ();
+ ensureOtherRefs ();
+}
Index: printmethod.cc
===================================================================
--- printmethod.cc (nonexistent)
+++ printmethod.cc (revision 513)
@@ -0,0 +1,35 @@
+/* This test script is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2004, 2005, 2007, 2008, 2009, 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 .
+ */
+
+/* Create some objects, and try to print out their methods. */
+
+class A {
+public:
+ virtual void virt() {};
+ void nonvirt() {};
+};
+
+int main()
+{
+ A *theA = new A;
+ theA->virt ();
+ theA->nonvirt ();
+
+ return 0; // breakpoint: constructs-done
+}
Index: exception.cc
===================================================================
--- exception.cc (nonexistent)
+++ exception.cc (revision 513)
@@ -0,0 +1,69 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1997, 1998, 2004, 2007, 2008, 2009, 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 .
+ */
+
+
+
+// Test file for exception handling support.
+
+#include
+using namespace std;
+
+int foo (int i)
+{
+ if (i < 32)
+ throw (int) 13;
+ else
+ return i * 2;
+}
+
+extern "C" int bar (int k, unsigned long eharg, int flag);
+
+int bar (int k, unsigned long eharg, int flag)
+{
+ cout << "k is " << k << " eharg is " << eharg << " flag is " << flag << endl;
+ return 1;
+}
+
+int main()
+{
+ int j;
+
+ try {
+ j = foo (20);
+ }
+ catch (int x) {
+ cout << "Got an except " << x << endl;
+ }
+
+ try {
+ try {
+ j = foo (20);
+ }
+ catch (int x) {
+ cout << "Got an except " << x << endl;
+ throw;
+ }
+ }
+ catch (int y) {
+ cout << "Got an except (rethrown) " << y << endl;
+ }
+
+ // Not caught
+ foo (20);
+}
Index: annota3.cc
===================================================================
--- annota3.cc (nonexistent)
+++ annota3.cc (revision 513)
@@ -0,0 +1,28 @@
+#include
+
+class A {
+public:
+ int x;
+ int y;
+ int foo (int arg);
+};
+
+
+int A::foo (int arg)
+{
+ x += arg;
+ return arg *2;
+}
+
+int main()
+{
+ A a;
+
+ a.x = 0;
+ a.x = 1;
+ a.y = 2;
+
+ printf ("a.x is %d\n", a.x);
+ return 0;
+}
+
Index: ref-params.exp
===================================================================
--- ref-params.exp (nonexistent)
+++ ref-params.exp (revision 513)
@@ -0,0 +1,78 @@
+# Tests for reference parameters of types and their subtypes in GDB.
+# Copyright 2006, 2007, 2008, 2009, 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 .
+
+# written by Paul N. Hilfinger (Hilfinger@adacore.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "ref-params"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested ref-params.exp
+ return -1
+}
+
+gdb_exit
+
+proc gdb_start_again { text } {
+ global srcdir
+ global subdir
+ global binfile
+ global srcfile
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ runto ${srcfile}:[gdb_get_line_number $text]
+}
+
+gdb_start_again "marker1 here"
+gdb_test "print Q" ".*id = 42.*" "print value of a Child in main"
+gdb_test "print f1(Q)" ".* = 42.*" "print value of f1 on Child in main"
+gdb_test "print f2(Q)" ".* = 42.*" "print value of f2 on Child in main"
+
+gdb_start_again "marker1 here"
+gdb_test "print f1(QR)" ".* = 42.*" "print value of f1 on (Child&) in main"
+
+gdb_start_again "marker1 here"
+gdb_test "print f2(QR)" ".* = 42.*" "print value of f2 on (Child&) in main"
+
+gdb_start_again "marker2 here"
+gdb_test "print C" ".*id = 42.*" "print value of Child& in f2"
+gdb_test "print f1(C)" ".* = 42.*" "print value of f1 on Child& in f2"
+
+gdb_start_again "marker3 here"
+gdb_test "print R" ".*id = 42.*" "print value of Parent& in f1"
+
+gdb_start_again "breakpoint MQ here"
+gdb_test "print f1(MQ)" ".* = 53"
+gdb_test "print mf1(MQ)" ".* = 106"
+gdb_test "print mf2(MQ)" ".* = 106"
+gdb_test "print f1(MQR)" ".* = 53"
+gdb_test "print mf1(MQR)" ".* = 106"
+gdb_test "print mf2(MQR)" ".* = 106"
Index: rtti2.cc
===================================================================
--- rtti2.cc (nonexistent)
+++ rtti2.cc (revision 513)
@@ -0,0 +1,38 @@
+/* Code to go along with tests in rtti.exp.
+
+ Copyright 2003, 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+ Contributed by David Carlton and by Kealia,
+ Inc.
+
+ This file is part of GDB.
+
+ 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 . */
+
+#include "rtti.h"
+
+namespace n2 {
+
+ D2::D2(C2 *expr_1, C2 *expr_2)
+ : expr_1_(expr_1), expr_2_(expr_2) { }
+
+ C2 *create2() {
+ return new D2(0, 0);
+ }
+
+ n3::C3 *create3() {
+ return new n3::C3();
+ }
+
+}
Index: exception.exp
===================================================================
--- exception.exp (nonexistent)
+++ exception.exp (revision 513)
@@ -0,0 +1,232 @@
+# Copyright 1997, 1998, 2004, 2005, 2007, 2008, 2009, 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 .
+
+# This file is part of the gdb testsuite.
+# tests for exception-handling support
+# Written by Satish Pai 1997-07-23
+# Rewritten by Michael Chastain 2004-01-08
+
+# This file used to have two copies of the tests with different
+# compiler flags for hp-ux. Instead, the user should set CXXOPTS
+# or run runtest with --target_board unix/gdb:debug_flags="..."
+# to choose the compiler flags.
+#
+# The interesting compiler flags are: "aCC +A -Wl,-a,-archive" .
+# Static-linked executables use a different mechanism to get the
+# address of the notification hook in the C++ support library.
+
+# TODO: this file has many absolute line numbers.
+# Replace them with gdb_get_line_number.
+
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_stl_tests] } { continue }
+
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+set testfile "exception"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested exception.exp
+ return -1
+}
+
+# Start with a fresh gdb
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Set a catch catchpoint
+
+gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \
+ "catch catch (before inferior run)"
+
+# Set a throw catchpoint
+
+gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \
+ "catch throw (before inferior run)"
+
+
+# The catchpoints should be listed in the list of breakpoints.
+# In case of a statically linked test, we won't have a pending breakpoint.
+# Hence we allow for both an address or "". If we ever become able
+# to tell whether the target is linked statically or not, we can be more
+# precise and require exact output.
+set addr "\(|$hex\)"
+set re_head "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What"
+set re_2_bp "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch"
+set re_3_bp "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw"
+
+set name "info breakpoints (before inferior run)"
+gdb_test_multiple "info breakpoints" $name {
+ -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re ".*$gdb_prompt $"
+ {
+ fail $name
+ }
+}
+
+gdb_test "tbreak main" "Temporary breakpoint 3.*" \
+ "Set temporary breakpoint at main"
+
+set ok 0
+gdb_run_cmd
+gdb_test_multiple "" "Run to main" {
+ -re "Temporary breakpoint 3,.*$gdb_prompt $" {
+ pass "Run to main"
+ set ok 1
+ }
+}
+
+if { !$ok } {
+ continue
+}
+
+set addr "$hex"
+set re_head "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What"
+set re_2_bp "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch"
+set re_3_bp "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw"
+
+set name "info breakpoints (after inferior run)"
+gdb_test_multiple "info breakpoints" $name {
+ -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re ".*$gdb_prompt $"
+ {
+ send_user "\n---\n$expect_out(buffer)\n---\n"
+ fail $name
+ }
+}
+
+# Get the first exception thrown
+
+set name "continue to first throw"
+gdb_test_multiple "continue" $name {
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\), throw location.*${srcfile}:30, catch location .*${srcfile}:50\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Backtrace from the throw point.
+# This should get to user code.
+
+set name "backtrace after first throw"
+gdb_test_multiple "backtrace" $name {
+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" {
+ # Either __cxxabiv1::__cxa_throw or __cxa_throw can be printed
+ # depending on debug info presence.
+ pass $name
+ }
+}
+
+# Continue to the catch.
+
+set name "continue to first catch"
+gdb_test_multiple "continue" $name {
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\), throw location.*${srcfile}:30, catch location .*${srcfile}:50\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Backtrace from the catch point.
+# This should get to user code.
+
+set name "backtrace after first catch"
+gdb_test_multiple "backtrace" $name {
+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Continue to second throw.
+
+set name "continue to second throw"
+gdb_test_multiple "continue" $name {
+ -re "Continuing.${ws}Got an except 13${ws}Catchpoint \[0-9\]+ \\(exception thrown\\), throw location.*${srcfile}:30, catch location .*${srcfile}:58\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Continuing.${ws}Got an except 13${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Backtrace from the throw point.
+# This should get to user code.
+
+set name "backtrace after second throw"
+gdb_test_multiple "backtrace" $name {
+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Continue to second catch.
+
+set name "continue to second catch"
+gdb_test_multiple "continue" $name {
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\), throw location.*${srcfile}:30, catch location .*${srcfile}:58\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# Backtrace from the catch point.
+# This should get to user code.
+
+set name "backtrace after second catch"
+gdb_test_multiple "backtrace" $name {
+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" {
+ pass $name
+ }
+}
+
+# That is all for now.
+#
+# The original code had:
+#
+# continue to re-throw ; backtrace
+# continue to catch ; backtrace
+# continue to throw out of main
+#
+# The problem is that "re-throw" does not show a throw; only a catch.
+# I do not know if this is because of a bug, or because the generated
+# code is optimized for a throw into the same function.
+#
+# -- chastain 2004-01-09
Index: psmang1.cc
===================================================================
--- psmang1.cc (nonexistent)
+++ psmang1.cc (revision 513)
@@ -0,0 +1,178 @@
+/* This test script is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2004,
+ 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 .
+ */
+
+/* Do not move this definition into a header file! See the comments
+ in psmang.exp. */
+struct s
+{
+ int value;
+ void method1 (void);
+ void method2 (void);
+};
+
+void
+s::method1 ()
+{
+ value = 42;
+}
+
+int
+main (int argc, char **argv)
+{
+ s si;
+
+ si.method1 ();
+ si.method2 ();
+}
+
+
+/* The presence of these variables ensures there will be so many
+ symbols in psmang1.cc's symtab's global block that it will have a
+ non-trivial hash table. When there are only a very few symbols,
+ the block only has one hash bucket, so even if we compute the hash
+ value for the wrong symbol name, we'll still find a symbol that
+ matches. */
+int ax;
+int bx;
+int a1x;
+int b1x;
+int a2x;
+int b2x;
+int a12x;
+int b12x;
+int a3x;
+int b3x;
+int a13x;
+int b13x;
+int a23x;
+int b23x;
+int a123x;
+int b123x;
+int a4x;
+int b4x;
+int a14x;
+int b14x;
+int a24x;
+int b24x;
+int a124x;
+int b124x;
+int a34x;
+int b34x;
+int a134x;
+int b134x;
+int a234x;
+int b234x;
+int a1234x;
+int b1234x;
+int a5x;
+int b5x;
+int a15x;
+int b15x;
+int a25x;
+int b25x;
+int a125x;
+int b125x;
+int a35x;
+int b35x;
+int a135x;
+int b135x;
+int a235x;
+int b235x;
+int a1235x;
+int b1235x;
+int a45x;
+int b45x;
+int a145x;
+int b145x;
+int a245x;
+int b245x;
+int a1245x;
+int b1245x;
+int a345x;
+int b345x;
+int a1345x;
+int b1345x;
+int a2345x;
+int b2345x;
+int a12345x;
+int b12345x;
+int a6x;
+int b6x;
+int a16x;
+int b16x;
+int a26x;
+int b26x;
+int a126x;
+int b126x;
+int a36x;
+int b36x;
+int a136x;
+int b136x;
+int a236x;
+int b236x;
+int a1236x;
+int b1236x;
+int a46x;
+int b46x;
+int a146x;
+int b146x;
+int a246x;
+int b246x;
+int a1246x;
+int b1246x;
+int a346x;
+int b346x;
+int a1346x;
+int b1346x;
+int a2346x;
+int b2346x;
+int a12346x;
+int b12346x;
+int a56x;
+int b56x;
+int a156x;
+int b156x;
+int a256x;
+int b256x;
+int a1256x;
+int b1256x;
+int a356x;
+int b356x;
+int a1356x;
+int b1356x;
+int a2356x;
+int b2356x;
+int a12356x;
+int b12356x;
+int a456x;
+int b456x;
+int a1456x;
+int b1456x;
+int a2456x;
+int b2456x;
+int a12456x;
+int b12456x;
+int a3456x;
+int b3456x;
+int a13456x;
+int b13456x;
+int a23456x;
+int b23456x;
+int a123456x;
+int b123456x;
Index: pr9167.cc
===================================================================
--- pr9167.cc (nonexistent)
+++ pr9167.cc (revision 513)
@@ -0,0 +1,36 @@
+#include
+
+template
+struct ATB
+{
+ int data;
+ ATB() : data(0) {}
+};
+
+
+template
+class A : public ATB
+{
+public:
+ static DerivedType const DEFAULT_INSTANCE;
+};
+
+template
+const DerivedType A::DEFAULT_INSTANCE;
+
+class B : public A
+{
+
+};
+
+int main()
+{
+ B b;
+ // If this if-block is removed then GDB shall
+ // not infinitely recurse when trying to print b.
+
+ return 0; // marker
+}
+
+
Index: method2.exp
===================================================================
--- method2.exp (nonexistent)
+++ method2.exp (revision 513)
@@ -0,0 +1,70 @@
+# Copyright 2007, 2008, 2009, 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 .
+
+# This file is part of the gdb testsuite
+
+# This tests setting a break in an ambiguous c++ method with
+# current_language set to c.
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "method2"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested method2.exp
+ return -1
+}
+
+if [get_compiler_info $binfile "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+proc test_break { lang } {
+ global gdb_prompt
+
+ gdb_test "set lang $lang" \
+ "" \
+ "setting language $lang"
+
+ gdb_test_multiple "break A::method" "breaking in method ($lang)" {
+ -re ".0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. A::method\\(A\\*\\) at .*\[\r\n\]*.3. A::method\\(int\\) at .*\[\r\n\]*\[\r\n\]*.4. A::method\\(\\) at .*\[\r\n\]*> $" {
+ gdb_test "0" \
+ "canceled" \
+ "breaking in method ($lang)"
+ }
+ }
+}
+
+# We want in this test to double-check the contents of the multiple-choice
+# menu that's printed when a breakpoint location is ambiguous. So we need
+# to set multiple-symbols to "ask" first.
+gdb_test_no_output "set multiple-symbols ask"
+
+test_break "c"
+test_break "c++"
+
+gdb_continue_to_end "continue to end"
Index: bs15503.exp
===================================================================
--- bs15503.exp (nonexistent)
+++ bs15503.exp (revision 513)
@@ -0,0 +1,107 @@
+# Copyright 1992, 2004, 2005, 2007, 2008, 2009, 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 . */
+
+# Test case for CLLbs15503
+# This file was written by Sue Kimura (sue_kimura@hp.com)
+# Rewritten by Michael Chastain (mec.gnu@mindspring.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+if { [skip_stl_tests] } { continue }
+
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+set testfile "bs15503"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } {
+ untested bs15503.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Set breakpoint on template function
+
+gdb_test "break StringTest::testFunction" \
+ "Breakpoint $decimal at $hex: file .*${srcfile}, line $decimal."
+
+gdb_test "continue" \
+ ".*Breakpoint $decimal, StringTest::testFunction \\(this=$hex\\).*" \
+ "continue to StringTest"
+
+# Run to some random point in the middle of the function.
+
+gdb_breakpoint [gdb_get_line_number "find position where blank needs to be inserted"]
+gdb_continue_to_breakpoint "find position where blank needs to be inserted"
+
+# Call some string methods.
+
+gdb_test "print s.length()" "\\$\[0-9\]+ = 42"
+gdb_test "print s\[0\]" "\\$\[0-9\]+ =.* 'I'"
+gdb_test "print s\[s.length()-1\]" "\\$\[0-9\]+ =.* 'g'"
+gdb_test "print (const char *) s" \
+ "\\$\[0-9\]+ = $hex \"I am a short stringand now a longer string\""
+
+# TODO: tests that do not work with gcc 2.95.3
+# -- chastain 2004-01-07
+#
+# gdb_test "print s.compare(s)" "\\$\[0-9\]+ = 0"
+# gdb_test "print s.compare(\"AAA\")" "\\$\[0-9\]+ = 1"
+# gdb_test "print s.compare(\"ZZZ\")" "\\$\[0-9\]+ = -1"
+
+# TODO: tests that do not work with gcc 2.95.3 and gcc 3.3.2.
+# cannot call overloaded non-member operator. -- chastain 2004-01-07
+#
+# gdb_test "print s == s" "\\$\[0-9\]+ = true"
+# gdb_test "print s > "AAA" "\\$\[0-9\]+ = true"
+# gdb_test "print s < "ZZZ" "\\$\[0-9\]+ = true"
+
+# TODO: GDB doesn't know to convert the string to a const char *, and
+# instead tries to use the string as a structure initializer.
+#
+# gdb_test "print s == \"I am a short stringand now a longer string\"" \
+# "\\$\[0-9\]+ = true"
+
+gdb_test "print (const char *) s.substr(0,4)" "\\$\[0-9\]+ = $hex \"I am\""
+gdb_test "print (const char *) (s=s.substr(0,4))" \
+ "\\$\[0-9\]+ = $hex \"I am\""
+
+# TODO: cannot call overloaded non-member operator again.
+# -- chastain 2004-01-07
+#
+# gdb_test "print (const char *) (s + s)" \
+# "\\$\[0-9\]+ = $hex \"I amI am\""
+# gdb_test "print (const char *) (s + \" \" + s)" \
+# "\\$\[0-9\]+ = $hex \"I am I am\""
Index: ctti.exp
===================================================================
--- ctti.exp (nonexistent)
+++ ctti.exp (revision 513)
@@ -0,0 +1,212 @@
+# Copyright 1998, 1999, 2001, 2003, 2004, 2007, 2008, 2009, 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 .
+
+# This file is part of the gdb testsuite
+# file written by Elena Zannoni (ezannoni@cygnus.com)
+# rewritten by Michael Chastain (mec.gnu@mindspring.com)
+#
+# source files cttiadd.cc, cttiadd1.cc, cttiadd2.cc, cttiadd3.cc
+
+# Call to template instantiations.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "cttiadd"
+set srcfile "${testfile}.cc"
+set srcfile1 "${testfile}1.cc"
+set srcfile2 "${testfile}2.cc"
+set srcfile3 "${testfile}3.cc"
+set objfile "${testfile}.o"
+set objfile1 "${testfile}1.o"
+set objfile2 "${testfile}2.o"
+set objfile3 "${testfile}3.o"
+set binfile "${objdir}/${subdir}/${testfile}"
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile" "$objdir/$subdir/$objfile" object {debug c++}] != "" } {
+ untested ctti.exp
+ return -1
+}
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
+ untested ctti.exp
+ return -1
+}
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
+ untested ctti.exp
+ return -1
+}
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile3" "$objdir/$subdir/$objfile3" object {debug c++}] != "" } {
+ untested ctti.exp
+ return -1
+}
+
+if { [gdb_compile "$objdir/$subdir/$objfile $objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2 $objdir/$subdir/$objfile3" "${binfile}" executable {debug c++}] != "" } {
+ untested ctti.exp
+ return -1
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "marker add1"]
+gdb_continue_to_breakpoint "marker add1"
+
+gdb_test "print c" "\\$\[0-9\]+ = 194 .*"
+gdb_test "print f" "\\$\[0-9\]+ = 9"
+gdb_test "print i" "\\$\[0-9\]+ = 4"
+
+# TODO: this needs more work before actually deploying it.
+# So bail out here.
+
+if { [ test_compiler_info gcc-*] } then { continue }
+
+gdb_test_multiple "print add(2,2)" "print add(2,2)" {
+ -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ pass "print add(2,2)"
+ }
+ -re "No symbol \"add\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add(2,2)"
+ }
+}
+
+# Note: 2.25 and 4.5 are exactly representable in IEEE-ish formats
+gdb_test_multiple "print add(2.25,2.25)" "print add(2.25,2.25)" {
+ -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ pass "print add(2.25,2.25)"
+ }
+ -re "No symbol \"add\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add(2.25,2.25)"
+ }
+}
+
+gdb_test_multiple "print add('A','A')" "print add('A','A')" {
+ -re "\\$\[0-9\]+ = 130 .*\r\n$gdb_prompt $" {
+ pass "print add('A','A')"
+ }
+ -re "No symbol \"add\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add('A','A')"
+ }
+}
+
+gdb_test_multiple "print add2(2,2)" "print add2(2,2)" {
+ -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ pass "print add2(2,2)"
+ }
+ -re "No symbol \"add2\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add2(2,2)"
+ }
+}
+
+gdb_test_multiple "print add2(2.25,2.25)" "print add2(2.25,2.25)" {
+ -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ pass "print add2(2.25,2.25)"
+ }
+ -re "No symbol \"add2\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add2(2.25,2.25)"
+ }
+}
+
+gdb_test_multiple "print add2('A','A')" "print add2('A','A')" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ pass "print add2('A','A')"
+ }
+ -re "No symbol \"add2\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add2('A','A')"
+ }
+}
+
+gdb_test_multiple "print add3(2,2)" "print add3(2,2)" {
+ -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ pass "print add3(2,2)"
+ }
+ -re "No symbol \"add3\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add3(2,2)"
+ }
+}
+
+gdb_test_multiple "print add3(2.25,2.25)" "print add3(2.25,2.25)" {
+ -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ pass "print add3(2.25,2.25)"
+ }
+ -re "No symbol \"add3\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add3(2.25,2.25)"
+ }
+}
+
+gdb_test_multiple "print add3('A','A')" "print add3('A','A')" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ pass "print add3('A','A')"
+ }
+ -re "No symbol \"add3\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add3('A','A')"
+ }
+}
+
+gdb_test_multiple "print add4(2,2)" "print add4(2,2)" {
+ -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ pass "print add4(2,2)"
+ }
+ -re "No symbol \"add4\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add4(2,2)"
+ }
+}
+
+gdb_test_multiple "print add4(2.25,2.25)" "print add4(2.25,2.25)" {
+ -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ pass "print add4(2.25,2.25)"
+ }
+ -re "No symbol \"add4\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add4(2.25,2.25)"
+ }
+}
+
+gdb_test_multiple "print add4('A','A')" "print add4('A','A')" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ pass "print add4('A','A')"
+ }
+ -re "No symbol \"add4\" in current context.\r\n$gdb_prompt $" {
+ # TODO: kfail or xfail this
+ fail "print add4('A','A')"
+ }
+}
Index: casts.cc
===================================================================
--- casts.cc (nonexistent)
+++ casts.cc (revision 513)
@@ -0,0 +1,52 @@
+struct A
+{
+ int a;
+ A (int aa): a (aa) {}
+};
+
+struct B: public A
+{
+ int b;
+ B (int aa, int bb): A (aa), b(bb) {}
+};
+
+
+struct Alpha
+{
+ virtual void x() { }
+};
+
+struct Gamma
+{
+};
+
+struct Derived : public Alpha
+{
+};
+
+struct VirtuallyDerived : public virtual Alpha
+{
+};
+
+struct DoublyDerived : public VirtuallyDerived,
+ public virtual Alpha,
+ public Gamma
+{
+};
+
+int
+main (int argc, char **argv)
+{
+ A *a = new B(42, 1729);
+ B *b = (B *) a;
+ A &ar = *b;
+ B &br = (B&)ar;
+
+ Derived derived;
+ DoublyDerived doublyderived;
+
+ Alpha *ad = &derived;
+ Alpha *add = &doublyderived;
+
+ return 0; /* breakpoint spot: casts.exp: 1 */
+}
Index: gdb2384.cc
===================================================================
--- gdb2384.cc (nonexistent)
+++ gdb2384.cc (revision 513)
@@ -0,0 +1,53 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008, 2009, 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 .
+ */
+
+#include "gdb2384-base.h"
+
+class derived1 : public base
+{
+ public:
+ derived1 (int);
+};
+
+derived1::derived1 (int _x)
+ : base (_x)
+{
+}
+
+class derived2 : public derived
+{
+ public:
+ derived2 (int);
+};
+
+derived2::derived2 (int _x)
+ : derived (_x)
+{
+}
+
+int g;
+
+int
+main ()
+{
+ derived1 d1 (42);
+ derived2 d2 (24);
+ g = d1.meth (); // set breakpoint here
+ g = d2.meth (); // set breakpoint here (second)
+ return 0;
+}
Index: nsdecl.exp
===================================================================
--- nsdecl.exp (nonexistent)
+++ nsdecl.exp (revision 513)
@@ -0,0 +1,50 @@
+# Copyright 2008 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 .
+
+# Stress test the lookup of declarations
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+set testfile nsdecl
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint main"
+ continue
+}
+
+############################################
+# Test that the search can fail efficiently
+
+gdb_test "print fakex" "No symbol \"fakex\" in current context."
Index: hang.H
===================================================================
--- hang.H (nonexistent)
+++ hang.H (revision 513)
@@ -0,0 +1,12 @@
+struct A
+{
+ struct B *b_ptr_in_a;
+};
+
+struct C
+{
+ struct B
+ {
+ int member_of_B_in_C;
+ };
+};
hang.H
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: anon-union.cc
===================================================================
--- anon-union.cc (nonexistent)
+++ anon-union.cc (revision 513)
@@ -0,0 +1,56 @@
+
+struct Foo {
+ union {
+ int zero;
+ unsigned int one;
+ } num1;
+ struct X {
+ int rock;
+ unsigned int rock2;
+ };
+ union {
+ int pebble;
+ X x;
+ union {
+ int qux;
+ unsigned int mux;
+ };
+ unsigned int boulder;
+ };
+ union {
+ int paper;
+ unsigned int cloth;
+ };
+ union {
+ int two;
+ unsigned int three;
+ } num2;
+};
+
+union Bar {
+ int x;
+ unsigned int y;
+};
+
+
+int main()
+{
+ Foo foo = {0, 0};
+
+ foo.paper = 33;
+ foo.pebble = 44;
+ foo.mux = 55;
+
+ Bar bar = {0};
+
+ union {
+ int z;
+ unsigned int w;
+ }; w = 0;
+
+ bar.x = 33;
+
+ w = 45;
+
+ int j = 0;
+}
Index: try_catch.exp
===================================================================
--- try_catch.exp (nonexistent)
+++ try_catch.exp (revision 513)
@@ -0,0 +1,80 @@
+# Copyright 2002, 2007, 2008, 2009, 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 .
+
+# Tests for member data
+# 2002-05-27 Benjamin Kosnik
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_stl_tests] } { continue }
+
+#
+# test running programs
+#
+
+set testfile "try_catch"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested try_catch.exp
+ return -1
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "marker 1-throw"]
+gdb_continue_to_breakpoint "marker 1-throw"
+
+gdb_breakpoint [gdb_get_line_number "marker 1-catch"]
+gdb_continue_to_breakpoint "marker 1-catch"
+
+gdb_breakpoint [gdb_get_line_number "marker 2-start"]
+gdb_continue_to_breakpoint "marker 2-start"
+
+gdb_breakpoint [gdb_get_line_number "marker 2-next"]
+gdb_continue_to_breakpoint "marker 2-next"
+
+gdb_breakpoint [gdb_get_line_number "marker 2-throw"]
+gdb_continue_to_breakpoint "marker 2-throw"
+
+gdb_breakpoint [gdb_get_line_number "marker 2-catch"]
+gdb_continue_to_breakpoint "marker 2-catch"
+
+gdb_breakpoint [gdb_get_line_number "marker 3-throw"]
+gdb_continue_to_breakpoint "marker 3-throw"
+
+gdb_breakpoint [gdb_get_line_number "marker 3-catch"]
+gdb_continue_to_breakpoint "marker 3-catch"
+
+gdb_exit
+return 0
Index: ambiguous.cc
===================================================================
--- ambiguous.cc (nonexistent)
+++ ambiguous.cc (revision 513)
@@ -0,0 +1,110 @@
+
+void marker1()
+{
+ return;
+}
+
+class A1 {
+public:
+ int x;
+ int y;
+};
+
+class A2 {
+public:
+ int x;
+ int y;
+};
+
+class A3 {
+public:
+ int x;
+ int y;
+};
+
+class X : public A1, public A2 {
+public:
+ int z;
+};
+
+class L : public A1 {
+public:
+ int z;
+};
+
+class LV : public virtual A1 {
+public:
+ int z;
+};
+
+class M : public A2 {
+public:
+ int w;
+};
+
+class N : public L, public M {
+public:
+ int r;
+};
+
+class K : public A1 {
+public:
+ int i;
+};
+
+class KV : public virtual A1 {
+public:
+ int i;
+};
+
+class J : public K, public L {
+public:
+ int j;
+};
+
+class JV : public KV, public LV {
+public:
+ int jv;
+};
+
+class JVA1 : public KV, public LV, public A1 {
+public:
+ int jva1;
+};
+
+class JVA2 : public KV, public LV, public A2 {
+public:
+ int jva2;
+};
+
+class JVA1V : public KV, public LV, public virtual A1 {
+public:
+ int jva1v;
+};
+
+int main()
+{
+ A1 a1;
+ A2 a2;
+ A3 a3;
+ X x;
+ L l;
+ M m;
+ N n;
+ K k;
+ J j;
+ JV jv;
+ JVA1 jva1;
+ JVA2 jva2;
+ JVA1V jva1v;
+
+ int i;
+
+ i += k.i + m.w + a1.x + a2.x + a3.x + x.z + l.z + n.r + j.j;
+
+ marker1();
+
+}
+
+
+
Index: bool.cc
===================================================================
--- bool.cc (nonexistent)
+++ bool.cc (revision 513)
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 . */
+
+bool
+return_true ()
+{
+ return true;
+}
+
+bool
+return_false ()
+{
+ return false;
+}
+
+int
+main ()
+{
+ return_true ();
+ return_false ();
+}
Index: mb-inline2.cc
===================================================================
--- mb-inline2.cc (nonexistent)
+++ mb-inline2.cc (revision 513)
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008, 2009, 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 .
+ */
+
+#include "mb-inline.h"
+
+int
+bfn ()
+{
+ return foo (1) + multi_line_foo (1);
+}
Index: extern-c.exp
===================================================================
--- extern-c.exp (nonexistent)
+++ extern-c.exp (revision 513)
@@ -0,0 +1,65 @@
+# Copyright 2009, 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 .
+
+# Test breakpoints on extern "C" functions implemented in C++.
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "extern-c"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested extern-c.exp
+ return -1
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+runto_main
+
+if { [gdb_breakpoint "c_func"] == 1 } {
+ pass "setting breakpoint at c_func"
+}
+gdb_continue_to_breakpoint "c_func" ".*c_func.*"
+
+gdb_test_no_output "set \$counter = 0" "initialize counter"
+
+gdb_test "rbreak c_funcs" \
+ "Breakpoint.* at .*c_funcs_1.*Breakpoint.* at .*c_funcs_2.*"
+
+# Test that "commands" without an argument puts commands on both
+# breakpoints.
+gdb_test_multiple "commands" "set commands on multiple breakpoints" {
+ -re "Type commands for breakpoint\\(s\\) 3-4, one per line\.\r\nEnd with a line saying just \"end\".\r\n>$" {
+ gdb_test_multiple "set \$counter = \$counter + 1\nend" \
+ "command details for multiple breakpoints" {
+ -re "$gdb_prompt $" {
+ pass "command details for multiple breakpoints"
+ }
+ }
+ pass "set commands on multiple breakpoints"
+ }
+}
+
+gdb_continue_to_breakpoint "c_funcs_1" ".*c_funcs_1.*"
+gdb_test "print \$counter" " = 1" "verify counter at first breakpoint"
+gdb_continue_to_breakpoint "c_funcs_2" ".*c_funcs_2.*"
+gdb_test "print \$counter" " = 2" "verify counter at second breakpoint"
Index: ref-params.cc
===================================================================
--- ref-params.cc (nonexistent)
+++ ref-params.cc (revision 513)
@@ -0,0 +1,78 @@
+/* This test script is part of GDB, the GNU debugger.
+
+ Copyright 2006, 2007, 2008, 2009, 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 .
+ */
+
+/* Author: Paul N. Hilfinger, AdaCore Inc. */
+
+struct Parent {
+ Parent (int id0) : id(id0) { }
+ int id;
+};
+
+struct Child : public Parent {
+ Child (int id0) : Parent(id0) { }
+};
+
+int f1(Parent& R)
+{
+ return R.id; /* Set breakpoint marker3 here. */
+}
+
+int f2(Child& C)
+{
+ return f1(C); /* Set breakpoint marker2 here. */
+}
+
+struct OtherParent {
+ OtherParent (int other_id0) : other_id(other_id0) { }
+ int other_id;
+};
+
+struct MultiChild : public Parent, OtherParent {
+ MultiChild (int id0) : Parent(id0), OtherParent(id0 * 2) { }
+};
+
+int mf1(OtherParent& R)
+{
+ return R.other_id;
+}
+
+int mf2(MultiChild& C)
+{
+ return mf1(C);
+}
+
+int main(void)
+{
+ Child Q(42);
+ Child& QR = Q;
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+ /* Set breakpoint marker1 here. */
+
+ f2(Q);
+ f2(QR);
+
+ MultiChild MQ(53);
+ MultiChild& MQR = MQ;
+
+ mf2(MQ); /* Set breakpoint MQ here. */
+}
Index: templates.cc
===================================================================
--- templates.cc (nonexistent)
+++ templates.cc (revision 513)
@@ -0,0 +1,802 @@
+/* This test code is from Wendell Baker (wbaker@comet.berkeley.edu) */
+
+#include
+
+int a_i;
+char a_c;
+double a_d;
+
+typedef void *Pix;
+
+int
+f(int i)
+{ return 0; }
+
+int
+f(int i, char c)
+{ return 0; }
+
+int
+f(int i, char c, double d)
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs)
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs, void (*fig)(int, char))
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs, void (*fig)(char, int))
+{ return 0; }
+
+class R {
+public:
+ int i;
+};
+class S {
+public:
+ int i;
+};
+class T {
+public:
+ int i;
+};
+
+char g(char, const char, volatile char)
+{ return 'c'; }
+char g(R, char&, const char&, volatile char&)
+{ return 'c'; }
+char g(char*, const char*, volatile char*)
+{ return 'c'; }
+char g(S, char*&, const char*&, volatile char*&)
+{ return 'c'; }
+
+signed char g(T,signed char, const signed char, volatile signed char)
+{ return 'c'; }
+signed char g(T, R, signed char&, const signed char&, volatile signed char&)
+{ return 'c'; }
+signed char g(T, signed char*, const signed char*, volatile signed char*)
+{ return 'c'; }
+signed char g(T, S, signed char*&, const signed char*&, volatile signed char*&)
+{ return 'c'; }
+
+unsigned char g(unsigned char, const unsigned char, volatile unsigned char)
+{ return 'c'; }
+unsigned char g(R, unsigned char&, const unsigned char&, volatile unsigned char&)
+{ return 'c'; }
+unsigned char g(unsigned char*, const unsigned char*, volatile unsigned char*)
+{ return 'c'; }
+unsigned char g(S, unsigned char*&, const unsigned char*&, volatile unsigned char*&)
+{ return 'c'; }
+
+short g(short, const short, volatile short)
+{ return 0; }
+short g(R, short&, const short&, volatile short&)
+{ return 0; }
+short g(short*, const short*, volatile short*)
+{ return 0; }
+short g(S, short*&, const short*&, volatile short*&)
+{ return 0; }
+
+signed short g(T, signed short, const signed short, volatile signed short)
+{ return 0; }
+signed short g(T, R, signed short&, const signed short&, volatile signed short&)
+{ return 0; }
+signed short g(T, signed short*, const signed short*, volatile signed short*)
+{ return 0; }
+signed short g(T, S, double, signed short*&, const signed short*&, volatile signed short*&)
+{ return 0; }
+
+unsigned short g(unsigned short, const unsigned short, volatile unsigned short)
+{ return 0; }
+unsigned short g(R, unsigned short&, const unsigned short&, volatile unsigned short&)
+{ return 0; }
+unsigned short g(unsigned short*, const unsigned short*, volatile unsigned short*)
+{ return 0; }
+unsigned short g(S, unsigned short*&, const unsigned short*&, volatile unsigned short*&)
+{ return 0; }
+
+int g(int, const int, volatile int)
+{ return 0; }
+int g(R, int&, const int&, volatile int&)
+{ return 0; }
+int g(int*, const int*, volatile int*)
+{ return 0; }
+int g(S, int*&, const int*&, volatile int*&)
+{ return 0; }
+
+signed int g(T, signed int, const signed int, volatile signed int)
+{ return 0; }
+signed int g(T, R, signed int&, const signed int&, volatile signed int&)
+{ return 0; }
+signed int g(T, signed int*, const signed int*, volatile signed int*)
+{ return 0; }
+signed int g(T, S, signed int*&, const signed int*&, volatile signed int*&)
+{ return 0; }
+
+unsigned int g(unsigned int, const unsigned int, volatile unsigned int)
+{ return 0; }
+unsigned int g(R, unsigned int&, const unsigned int&, volatile unsigned int&)
+{ return 0; }
+unsigned int g(unsigned int*, const unsigned int*, volatile unsigned int*)
+{ return 0; }
+unsigned int g(S, unsigned int*&, const unsigned int*&, volatile unsigned int*&)
+{ return 0; }
+
+long g(long, const long, volatile long)
+{ return 0; }
+long g(R, long&, const long&, volatile long&)
+{ return 0; }
+long g(long*, const long*, volatile long*)
+{ return 0; }
+long g(S, long*&, const long*&, volatile long*&)
+{ return 0; }
+
+signed long g(T, signed long, const signed long, volatile signed long)
+{ return 0; }
+signed long g(T, R, signed long&, const signed long&, volatile signed long&)
+{ return 0; }
+signed long g(T, signed long*, const signed long*, volatile signed long*)
+{ return 0; }
+signed long g(T, S, signed long*&, const signed long*&, volatile signed long*&)
+{ return 0; }
+
+unsigned long g(unsigned long, const unsigned long, volatile unsigned long)
+{ return 0; }
+unsigned long g(S, unsigned long&, const unsigned long&, volatile unsigned long&)
+{ return 0; }
+unsigned long g(unsigned long*, const unsigned long*, volatile unsigned long*)
+{ return 0; }
+unsigned long g(S, unsigned long*&, const unsigned long*&, volatile unsigned long*&)
+{ return 0; }
+
+#ifdef __GNUC__
+long long g(long long, const long long, volatile long long)
+{ return 0; }
+long long g(S, long long&, const long long&, volatile long long&)
+{ return 0; }
+long long g(long long*, const long long*, volatile long long*)
+{ return 0; }
+long long g(R, long long*&, const long long*&, volatile long long*&)
+{ return 0; }
+
+signed long long g(T, signed long long, const signed long long, volatile signed long long)
+{ return 0; }
+signed long long g(T, R, signed long long&, const signed long long&, volatile signed long long&)
+{ return 0; }
+signed long long g(T, signed long long*, const signed long long*, volatile signed long long*)
+{ return 0; }
+signed long long g(T, S, signed long long*&, const signed long long*&, volatile signed long long*&)
+{ return 0; }
+
+unsigned long long g(unsigned long long, const unsigned long long, volatile unsigned long long)
+{ return 0; }
+unsigned long long g(R, unsigned long long*, const unsigned long long*, volatile unsigned long long*)
+{ return 0; }
+unsigned long long g(unsigned long long&, const unsigned long long&, volatile unsigned long long&)
+{ return 0; }
+unsigned long long g(S, unsigned long long*&, const unsigned long long*&, volatile unsigned long long*&)
+{ return 0; }
+#endif
+
+float g(float, const float, volatile float)
+{ return 0; }
+float g(char, float&, const float&, volatile float&)
+{ return 0; }
+float g(float*, const float*, volatile float*)
+{ return 0; }
+float g(char, float*&, const float*&, volatile float*&)
+{ return 0; }
+
+double g(double, const double, volatile double)
+{ return 0; }
+double g(char, double&, const double&, volatile double&)
+{ return 0; }
+double g(double*, const double*, volatile double*)
+{ return 0; }
+double g(char, double*&, const double*&, volatile double*&)
+{ return 0; }
+
+#ifdef __GNUC__
+long double g(long double, const long double, volatile long double)
+{ return 0; }
+long double g(char, long double&, const long double&, volatile long double&)
+{ return 0; }
+long double g(long double*, const long double*, volatile long double*)
+{ return 0; }
+long double g(char, long double*&, const long double*&, volatile long double*&)
+{ return 0; }
+#endif
+
+class c {
+public:
+ c(int) {};
+ int i;
+};
+
+class c g(c, const c, volatile c)
+{ return 0; }
+c g(char, c&, const c&, volatile c&)
+{ return 0; }
+c g(c*, const c*, volatile c*)
+{ return 0; }
+c g(char, c*&, const c*&, volatile c*&)
+{ return 0; }
+
+/*
+void h(char = 'a')
+{ }
+void h(char, signed char = 'a')
+{ }
+void h(unsigned char = 'a')
+{ }
+*/
+/*
+void h(char = (char)'a')
+{ }
+void h(char, signed char = (signed char)'a')
+{ }
+void h(unsigned char = (unsigned char)'a')
+{ }
+
+
+void h(short = (short)43)
+{ }
+void h(char, signed short = (signed short)43)
+{ }
+void h(unsigned short = (unsigned short)43)
+{ }
+
+void h(int = (int)43)
+{ }
+void h(char, signed int = (signed int)43)
+{ }
+void h(unsigned int = (unsigned int)43)
+{ }
+
+
+void h(long = (long)43)
+{ }
+void h(char, signed long = (signed long)43)
+{ }
+void h(unsigned long = (unsigned long)43)
+{ }
+
+#ifdef __GNUC__
+void h(long long = 43)
+{ }
+void h(char, signed long long = 43)
+{ }
+void h(unsigned long long = 43)
+{ }
+#endif
+
+void h(float = 4.3e-10)
+{ }
+void h(double = 4.3)
+{ }
+#ifdef __GNUC__
+void h(long double = 4.33e33)
+{ }
+#endif
+*/
+
+/* An unneeded printf() definition - actually, just a stub - used to occupy
+ this space. It has been removed and replaced with this comment which
+ exists to occupy some lines so that templates.exp won't need adjustment. */
+
+class T1 {
+public:
+ static void* operator new(size_t) throw ();
+ static void operator delete(void *pointer);
+
+ void operator=(const T1&);
+ T1& operator=(int);
+
+ int operator==(int) const;
+ int operator==(const T1&) const;
+ int operator!=(int) const;
+ int operator!=(const T1&) const;
+
+ int operator<=(int) const;
+ int operator<=(const T1&) const;
+ int operator<(int) const;
+ int operator<(const T1&) const;
+ int operator>=(int) const;
+ int operator>=(const T1&) const;
+ int operator>(int) const;
+ int operator>(const T1&) const;
+
+ void operator+(int) const;
+ T1& operator+(const T1&) const;
+ void operator+=(int) const;
+ T1& operator+=(const T1&) const;
+
+ T1& operator++() const;
+
+ void operator-(int) const;
+ T1& operator-(const T1&) const;
+ void operator-=(int) const;
+ T1& operator-=(const T1&) const;
+
+ T1& operator--() const;
+
+ void operator*(int) const;
+ T1& operator*(const T1&) const;
+ void operator*=(int) const;
+ T1& operator*=(const T1&) const;
+
+ void operator/(int) const;
+ T1& operator/(const T1&) const;
+ void operator/=(int) const;
+ T1& operator/=(const T1&) const;
+
+ void operator%(int) const;
+ T1& operator%(const T1&) const;
+ void operator%=(int) const;
+ T1& operator%=(const T1&) const;
+
+ void operator&&(int) const;
+ T1& operator&&(const T1&) const;
+
+ void operator||(int) const;
+ T1& operator||(const T1&) const;
+
+ void operator&(int) const;
+ T1& operator&(const T1&) const;
+ void operator&=(int) const;
+ T1& operator&=(const T1&) const;
+
+ void operator|(int) const;
+ T1& operator|(const T1&) const;
+ void operator|=(int) const;
+ T1& operator|=(const T1&) const;
+
+ void operator^(int) const;
+ T1& operator^(const T1&) const;
+ void operator^=(int) const;
+ T1& operator^=(const T1&) const;
+
+ T1& operator!() const;
+ T1& operator~() const;
+};
+
+void*
+T1::operator new(size_t) throw ()
+{ return 0; }
+
+void
+T1::operator delete(void *pointer)
+{ }
+
+class T2 {
+public:
+ T2(int i): integer(i)
+ { }
+ int integer;
+};
+
+int operator==(const T2&, const T2&)
+{ return 0; }
+int operator==(const T2&, char)
+{ return 0; }
+int operator!=(const T2&, const T2&)
+{ return 0; }
+int operator!=(const T2&, char)
+{ return 0; }
+
+int operator<=(const T2&, const T2&)
+{ return 0; }
+int operator<=(const T2&, char)
+{ return 0; }
+int operator<(const T2&, const T2&)
+{ return 0; }
+int operator<(const T2&, char)
+{ return 0; }
+int operator>=(const T2&, const T2&)
+{ return 0; }
+int operator>=(const T2&, char)
+{ return 0; }
+int operator>(const T2&, const T2&)
+{ return 0; }
+int operator>(const T2&, char)
+{ return 0; }
+
+T2 operator+(const T2 t, int i)
+{ return t.integer + i; }
+T2 operator+(const T2 a, const T2& b)
+{ return a.integer + b.integer; }
+T2& operator+=(T2& t, int i)
+{ t.integer += i; return t; }
+T2& operator+=(T2& a, const T2& b)
+{ a.integer += b.integer; return a; }
+
+T2 operator-(const T2 t, int i)
+{ return t.integer - i; }
+T2 operator-(const T2 a, const T2& b)
+{ return a.integer - b.integer; }
+T2& operator-=(T2& t, int i)
+{ t.integer -= i; return t; }
+T2& operator-=(T2& a, const T2& b)
+{ a.integer -= b.integer; return a; }
+
+T2 operator*(const T2 t, int i)
+{ return t.integer * i; }
+T2 operator*(const T2 a, const T2& b)
+{ return a.integer * b.integer; }
+T2& operator*=(T2& t, int i)
+{ t.integer *= i; return t; }
+T2& operator*=(T2& a, const T2& b)
+{ a.integer *= b.integer; return a; }
+
+T2 operator/(const T2 t, int i)
+{ return t.integer / i; }
+T2 operator/(const T2 a, const T2& b)
+{ return a.integer / b.integer; }
+T2& operator/=(T2& t, int i)
+{ t.integer /= i; return t; }
+T2& operator/=(T2& a, const T2& b)
+{ a.integer /= b.integer; return a; }
+
+T2 operator%(const T2 t, int i)
+{ return t.integer % i; }
+T2 operator%(const T2 a, const T2& b)
+{ return a.integer % b.integer; }
+T2& operator%=(T2& t, int i)
+{ t.integer %= i; return t; }
+T2& operator%=(T2& a, const T2& b)
+{ a.integer %= b.integer; return a; }
+
+template
+class T5 {
+public:
+ T5(int);
+ T5(const T5&);
+ ~T5();
+ static void* operator new(size_t) throw ();
+ static void operator delete(void *pointer);
+ int value();
+
+ static T X;
+ T x;
+ int val;
+};
+
+template
+T5::T5(int v)
+{ val = v; }
+
+template
+T5::T5(const T5&)
+{}
+
+template
+T5::~T5()
+{}
+
+template
+void*
+T5::operator new(size_t) throw ()
+{ return 0; }
+
+template
+void
+T5::operator delete(void *pointer)
+{ }
+
+template
+int
+T5::value()
+{ return val; }
+
+template
+T GetMax (T a, T b) {
+ T result;
+ result = (a>b)? a : b;
+ // set breakpoint on a line with no real code
+ return (result);
+}
+
+#if ! defined(__GNUC__) || defined(GCC_BUG)
+template
+T T5::X;
+#endif
+
+
+
+
+T5 t5c(1);
+T5 t5i(2);
+T5 t5fi1(3);
+T5 t5fi2(4);
+
+
+
+
+
+
+class x {
+public:
+ int (*manage[5])(double,
+ void *(*malloc)(unsigned size),
+ void (*free)(void *pointer));
+ int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra),
+ int *(*read)(int fd, void *place, unsigned size),
+ int *(*write)(int fd, void *place, unsigned size),
+ void (*close)(int fd));
+};
+T5 t5x(5);
+
+#if !defined(__GNUC__) || (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
+template class T5;
+template class T5;
+template class T5;
+template class T5;
+template class T5;
+#endif
+
+class T7 {
+public:
+ static int get();
+ static void put(int);
+};
+
+int
+T7::get()
+{ return 1; }
+
+void
+T7::put(int i)
+{
+ // nothing
+}
+
+// More template kinds. GDB 4.16 didn't handle these, but
+// Wildebeest does. Note: Assuming HP aCC is used to compile
+// this file; with g++ or HP cfront or other compilers the
+// demangling may not get done correctly.
+
+// Ordinary template, to be instantiated with different types
+template
+class Foo {
+public:
+ int x;
+ T t;
+ T foo (int, T);
+};
+
+
+template T Foo::foo (int i, T tt)
+{
+ return tt;
+}
+
+// Template with int parameter
+
+template
+class Bar {
+public:
+ int x;
+ T t;
+ T bar (int, T);
+};
+
+
+template T Bar::bar (int i, T tt)
+{
+ if (i < sz)
+ return tt;
+ else
+ return 0;
+}
+
+// function template with int parameter
+template int dummy (T tt, int i)
+{
+ return tt;
+}
+
+// Template with partial specializations
+template
+class Spec {
+public:
+ int x;
+ T1 spec (T2);
+};
+
+template
+T1 Spec::spec (T2 t2)
+{
+ return 0;
+}
+
+template
+class Spec {
+public:
+ int x;
+ T spec (T*);
+};
+
+template
+T Spec::spec (T * tp)
+{
+ return *tp;
+}
+
+// Template with char parameter
+template
+class Baz {
+public:
+ ~Baz () { };
+ int x;
+ T t;
+ T baz (int, T);
+};
+
+template T Baz::baz (int i, T tt)
+{
+ if (i < sz)
+ return tt;
+ else
+ return 0;
+}
+
+typedef Baz intBazOne;
+
+// Template with char * parameter
+template
+class Qux {
+public:
+ int x;
+ T t;
+ T qux (int, T);
+};
+
+template T Qux::qux (int i, T tt)
+{
+ if (sz[0] == 'q')
+ return tt;
+ else
+ return 0;
+}
+
+// Template with a function pointer parameter
+template
+class Qux1 {
+public:
+ int x;
+ T t;
+ T qux (int, T);
+};
+
+template T Qux1::qux (int i, T tt)
+{
+ if (f != 0)
+ return tt;
+ else
+ return 0;
+}
+
+// Some functions to provide as arguments to template
+int gf1 (int a) {
+ return a * 2 + 13;
+}
+int gf2 (int a) {
+ return a * 2 + 26;
+}
+
+char string[3];
+
+
+// Template for nested instantiations
+
+template
+class Garply {
+public:
+ int x;
+ T t;
+ T garply (int, T);
+};
+
+template T Garply::garply (int i, T tt)
+{
+ if (i > x)
+ return tt;
+ else
+ {
+ x += i;
+ return tt;
+ }
+}
+
+
+int main()
+{
+ int i;
+ long l, m, n;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ i = i + 1;
+
+ // New tests added here
+
+ Foo fint={0,0};
+ Foo fchar={0,0};
+ Foo fvpchar = {0, 0};
+
+ Bar bint;
+ Bar 3)> bint2;
+
+ Baz bazint;
+ Baz bazint2;
+
+ Qux quxint2;
+ Qux quxint;
+
+ Qux1 qux11;
+
+ int x = fint.foo(33, 47);
+ char c = fchar.foo(33, 'x');
+ volatile char * cp = fvpchar.foo(33, 0);
+
+ int y = dummy (400, 600);
+
+ int z = bint.bar(55, 66);
+ z += bint2.bar(55, 66);
+
+ c = bazint2.baz(4, 'y');
+ c = quxint2.qux(4, 'z');
+
+ y = bazint.baz(4,3);
+ y = quxint.qux(4, 22);
+ y += qux11.qux(4, 22);
+
+ y *= gf1(y) - gf2(y);
+
+ Spec sic;
+ Spec siip;
+
+ sic.spec ('c');
+ siip.spec (&x);
+
+ Garply f;
+ Garply fc;
+ f.x = 13;
+
+ Garply > nf;
+ nf.x = 31;
+
+ x = f.garply (3, 4);
+
+ fc = nf.garply (3, fc);
+
+ y = x + fc.x;
+
+ i=GetMax(x,y);
+ n=GetMax(l,m);
+
+ intBazOne ibo;
+ z = ibo.baz (2, 21);
+
+ t5i.value();
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: hang2.cc
===================================================================
--- hang2.cc (nonexistent)
+++ hang2.cc (revision 513)
@@ -0,0 +1,13 @@
+#include "hang.H"
+
+struct B
+{
+ int member_of_B;
+};
+
+int var_in_b = 1729;
+
+int dummy2 (void)
+{
+ return var_in_b;
+}
Index: formatted-ref.cc
===================================================================
--- formatted-ref.cc (nonexistent)
+++ formatted-ref.cc (revision 513)
@@ -0,0 +1,48 @@
+/* Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 . */
+
+/* Author: Paul N. Hilfinger, AdaCore Inc. */
+
+enum Enum1 { Val10=10, Val11, Val12 };
+
+struct Struct1
+{
+ int x, y;
+};
+
+int f1 (Struct1& s, Enum1& e, int& i)
+{
+ return s.x; /* Set breakpoint marker here. */
+}
+
+Struct1 s1 = { 13, 19 };
+
+int i1 = 23;
+
+Enum1 e1 = Val11;
+
+int main(void)
+{
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+ f1 (s1, e1, i1);
+
+}
Index: cttiadd3.cc
===================================================================
--- cttiadd3.cc (nonexistent)
+++ cttiadd3.cc (revision 513)
@@ -0,0 +1,52 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1998, 1999, 2004, 2007, 2008, 2009, 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 .
+ */
+
+template T add3(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+}
+
+template T add4(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+}
+
+void subr3()
+{
+ unsigned char c;
+ int i;
+ float f;
+
+ c = 'b';
+ i = 3;
+ f = 6.5;
+
+ c = add3(c, c);
+ i = add3(i, i);
+ f = add3(f, f);
+ c = add4(c, c);
+ i = add4(i, i);
+ f = add4(f, f);
+}
Index: mb-templates.exp
===================================================================
--- mb-templates.exp (nonexistent)
+++ mb-templates.exp (revision 513)
@@ -0,0 +1,187 @@
+# Copyright 2007, 2008, 2009, 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 .
+
+# This test verifies that setting breakpoint on line in template
+# function will fire in all instantiations of that template.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_stl_tests] } { continue }
+
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+
+set testfile "mb-templates"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested mb-templates.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set bp_location [gdb_get_line_number "set breakpoint here"]
+
+# Set a breakpoint with multiple locations
+# and a condition.
+
+gdb_test "break $srcfile:$bp_location if i==1" \
+ "Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
+ "initial condition: set breakpoint"
+
+gdb_run_cmd
+gdb_expect {
+ -re "Breakpoint \[0-9\]+,.*foo \\(i=1\\).*$gdb_prompt $" {
+ pass "initial condition: run to breakpoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "initial condition: run to breakpoint"
+ }
+ timeout {
+ fail "initial condition: run to breakpoint (timeout)"
+ }
+}
+
+gdb_test "continue" \
+ ".*Breakpoint.*foo \\(i=1\\).*" \
+ "initial condition: run to breakpoint 2"
+
+# Set breakpoint with multiple locations.
+# Separately set the condition.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "break $srcfile:$bp_location" \
+ "Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
+ "separate condition: set breakpoint"
+
+gdb_test_no_output "condition 1 i==1" \
+ "separate condition: set condition"
+
+gdb_run_cmd
+gdb_expect {
+ -re "Breakpoint \[0-9\]+,.*foo \\(i=1\\).*$gdb_prompt $" {
+ pass "separate condition: run to breakpoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "separate condition: run to breakpoint"
+ }
+ timeout {
+ fail "separate condition: run to breakpoint (timeout)"
+ }
+}
+
+gdb_test "continue" \
+ ".*Breakpoint.*foo \\(i=1\\).*" \
+ "separate condition: run to breakpoint 2"
+
+# Try disabling a single location. We also test
+# that at least in simple cases, the enable/disable
+# state of locations surive "run".
+gdb_test_no_output "disable 1.1" "disabling location: disable"
+
+gdb_run_cmd
+gdb_expect {
+ -re "Breakpoint \[0-9\]+,.*foo \\(i=1\\).*$gdb_prompt $" {
+ pass "disabling location: run to breakpoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "disabling location: run to breakpoint"
+ }
+ timeout {
+ fail "disabling location: run to breakpoint (timeout)"
+ }
+}
+
+# Try disabling entire breakpoint
+gdb_test_no_output "enable 1.1" "disabling location: enable"
+
+
+gdb_test_no_output "disable 1" "disable breakpoint: disable"
+
+gdb_run_cmd
+gdb_expect {
+ -re "Program exited normally.*$gdb_prompt $" {
+ pass "disable breakpoint: run to breakpoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "disable breakpoint: run to breakpoint"
+ }
+ timeout {
+ fail "disable breakpoint: run to breakpoint (timeout)"
+ }
+}
+
+# Make sure breakpoint can be set on a specific instantion.
+delete_breakpoints
+gdb_test "break 'void foo(int)'" ".*" \
+ "instantiation: set breakpoint"
+
+
+gdb_run_cmd
+gdb_expect {
+ -re ".*Breakpoint \[0-9\]+,.*foo \\(i=0\\).*$gdb_prompt $" {
+ pass "instantiation: run to breakpoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "instantiation: run to breakpoint"
+ }
+ timeout {
+ fail "instantiation: run to breakpoint (timeout)"
+ }
+}
+
+gdb_test "continue" \
+ ".*Breakpoint.*foo \\(i=1\\).*" \
+ "instantiation: run to breakpoint 2"
+
+
+# Make sure we can set a breakpoint on a source statement that spans
+# multiple lines.
+
+delete_breakpoints
+
+set bp_location [gdb_get_line_number "set multi-line breakpoint here"]
+
+if { ![runto_main] } {
+ fail "Can't run to main for multi_line_foo tests."
+ return 0
+}
+
+gdb_test "break $srcfile:$bp_location" \
+ "Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
+ "set multi_line_foo breakpoint"
+gdb_test "continue" \
+ ".*Breakpoint.*multi_line_foo \\(i=0\\).*" \
+ "run to multi_line_foo breakpoint 2 "
+gdb_test "continue" \
+ ".*Breakpoint.*multi_line_foo \\(i=0\\).*" \
+ "run to multi_line_foo breakpoint 2 "
Index: m-data.cc
===================================================================
--- m-data.cc (nonexistent)
+++ m-data.cc (revision 513)
@@ -0,0 +1,64 @@
+// 2002-05-13
+
+enum region { oriental, egyptian, greek, etruscan, roman };
+
+// Test one.
+class gnu_obj_1
+{
+protected:
+ typedef region antiquities;
+ const bool test;
+ const int key1;
+ long key2;
+
+ antiquities value;
+
+public:
+ gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
+};
+
+// Test two.
+template
+class gnu_obj_2: public virtual gnu_obj_1
+{
+protected:
+ antiquities value_derived;
+
+public:
+ gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
+};
+
+// Test three.
+template
+class gnu_obj_3
+{
+protected:
+ typedef region antiquities;
+ gnu_obj_2 data;
+
+public:
+ gnu_obj_3(antiquities b): data(etruscan) { }
+};
+
+int shadow = 0;
+
+class C
+{
+public:
+ C (int x) : shadow (x) {}
+ void marker () {}
+private:
+ int shadow;
+};
+
+int main()
+{
+ gnu_obj_1 test1(egyptian, 4589);
+ gnu_obj_2 test2(roman);
+ gnu_obj_3 test3(greek);
+
+ C theC (1); // breakpoint: first-constructs-done
+ theC.marker ();
+
+ return shadow;
+}
Index: userdef.exp
===================================================================
--- userdef.exp (nonexistent)
+++ userdef.exp (revision 513)
@@ -0,0 +1,157 @@
+# Tests of overloaded operators resolution.
+# Copyright 1998, 1999, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 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 .
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+#
+# source file "userdef.cc"
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_stl_tests] } { continue }
+
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+set testfile "userdef"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested userdef.exp
+ return -1
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "break marker1" \
+ "Breakpoint .*${srcfile}.*"
+
+gdb_test "cont" \
+ "Break.* marker1(\\(\\)|) \\(\\) at .*:$decimal.*" \
+ "continue to marker1"
+
+gdb_test "up" " in main .*" "up from marker1"
+
+gdb_test "print one + two" "\\\$\[0-9\]* = {x = 6, y = 8}"
+
+# If GDB fails to restore the selected frame properly after the
+# inferior function call above (see GDB PR 1155 for an explanation of
+# why this might happen), all the subsequent tests will fail. We
+# should detect report that failure, but let the marker call finish so
+# that the rest of the tests can run undisturbed.
+gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
+ -re "#0 marker1.*$gdb_prompt $" {
+ setup_kfail "gdb/1155" s390-*-linux-gnu
+ fail "re-selected 'main' frame after inferior call"
+ gdb_test "finish" ".*main.*at .*userdef.cc:.*// marker1-returns-here.*" \
+ "finish call to marker1"
+ }
+ -re "#1 ($hex in )?main.*$gdb_prompt $" {
+ pass "re-selected 'main' frame after inferior call"
+ }
+}
+
+gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}"
+
+gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}"
+
+gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}"
+
+gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
+gdb_test "print one && two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one || two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}"
+
+gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}"
+
+gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}"
+
+gdb_test "print one < two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one <= two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one > two" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one >= two" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one == two" "\\\$\[0-9\]* = 0\[\r\n\]"
+gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one != two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+# Can't really check the output of this one without knowing
+# target integer width. Make sure we don't try to call
+# the iostreams operator instead, though.
+gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}"
+
+# Should be fine even on < 32-bit targets.
+gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}"
+
+gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+# Assumes 2's complement. So does everything...
+gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
+gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}"
+
+gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}"
+
+gdb_test "print one++" "\\\$\[0-9\]* = {x = 2, y = 4}"
+
+gdb_test "print ++one" "\\\$\[0-9\]* = {x = 3, y = 4}"
+
+gdb_test "print one--" "\\\$\[0-9\]* = {x = 3, y = 3}"
+
+gdb_test "print --one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
+gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}"
+
+gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
+
+# Check that GDB tolerates whitespace in operator names.
+gdb_test "break A2::'operator+'" ".*Breakpoint $decimal at.*"
+gdb_test "break A2::'operator +'" ".*Breakpoint $decimal at.*"
+
+# Check that GDB handles operator* correctly.
+gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
+gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
+gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
+gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} &\\*"
+
+gdb_test "print operator== (mem1, mem2)" " = false"
+gdb_test "print operator== (mem1, mem1)" " = true"
+
+gdb_exit
+return 0
Index: templates.exp
===================================================================
--- templates.exp (nonexistent)
+++ templates.exp (revision 513)
@@ -0,0 +1,543 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2007,
+# 2008, 2009, 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 .
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+set ws "\[\r\n\t \]+"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "templates"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested templates.exp
+ return -1
+}
+
+#
+# Test printing of the types of templates.
+#
+
+proc test_ptype_of_templates {} {
+ global gdb_prompt
+ global ws
+
+ gdb_test_multiple "ptype T5" "ptype T5" {
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5 & operator=\\(T5 const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5 const|const T5) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype T5"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\(int\\);${ws}T5\\((T5 const|const T5) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}T5 & operator=\\(T5 const ?&\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype T5"
+ }
+ -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}${ws}$gdb_prompt $" {
+ pass "ptype T5 -- new with unsigned int"
+ }
+ -re "type = class T5 \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5 &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void ?\\*\\);.*int value \\((void|)\\);.*\\}\r\n$gdb_prompt $" {
+ pass "ptype T5 -- new with unsigned long"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5 & operator=\\(T5 const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5 const|const T5) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype T5 (obsolescent gcc or gdb)"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5 const|const T5) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ # This also triggers gdb/1113...
+ kfail "gdb/1111" "ptype T5"
+ }
+ }
+
+ gdb_test_multiple "ptype t5i" "ptype t5i" {
+ -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5 const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ pass "ptype T5 -- with several fixes from 4.17"
+ }
+ -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ pass "ptype t5i -- new with unsigned int"
+ }
+ -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ pass "ptype t5i -- new with unsigned long"
+ }
+ -re "type = class T5 \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
+ pass "ptype t5i"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5 & operator=\\(T5 const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5 const|const T5) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype t5i"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\(int\\);${ws}T5\\((T5 const|const T5) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}T5 & operator=\\(T5 const ?&\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype t5i"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5 & operator=\\(T5 const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5 const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype t5i (obsolescent gcc or gdb)"
+ }
+ -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5 const|const T5) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ # This also triggers gdb/1113...
+ kfail "gdb/1111" "ptype T5"
+ }
+ }
+}
+
+#
+# Test breakpoint setting on template methods.
+#
+
+proc test_template_breakpoints {} {
+ global gdb_prompt
+ global testfile
+ global srcdir
+ global hp_aCC_compiler
+
+ gdb_test_multiple "break T5::T5" "constructor breakpoint" {
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5::T5\\(int\\) at .*\[\r\n\]*.3. T5::T5\\((T5 const|const T5) ?&\\) at .*\[\r\n\]*> $" {
+ gdb_test "0" \
+ "canceled" \
+ "constructor breakpoint (obsolete format!)"
+ }
+ -re ".0. cancel\[\r\n\]*.1. all\[\r\n\]*.2. T5::T5\\((T5 const|const T5) ?&\\) at .*templates.cc:.*\[\r\n\]*.3. T5::T5\\(int\\) at .*templates.cc:.*\[\r\n\]*> $" {
+ gdb_test "0" \
+ "canceled" \
+ "constructor breakpoint"
+ }
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5 at .*\[\r\n\]*.3. T5 at .*\[\r\n\]*> $" {
+ setup_kfail "gdb/1062" "*-*-*"
+ gdb_test "0" \
+ "nonsense intended to insure that this test fails" \
+ "constructor breakpoint"
+ }
+ -re ".*\n> $" {
+ gdb_test "0" \
+ "nonsense intended to insure that this test fails" \
+ "constructor breakpoint (bad menu choices)"
+ }
+ }
+
+# See CLLbs14792
+ if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
+
+ gdb_test_multiple "break T5::~T5" "destructor_breakpoint" {
+ -re "Breakpoint.*at.* file .*${testfile}.cc, line.*$gdb_prompt $"
+ {
+ pass "destructor breakpoint"
+ }
+ -re "the class `T5' does not have destructor defined\r\nHint: try 'T5::~T5 or 'T5::~T5\r\n\\(Note leading single quote.\\)\r\n$gdb_prompt $"
+ {
+ kfail "gdb/1112" "destructor breakpoint"
+ }
+ }
+
+ gdb_test "break T5::value" \
+ "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
+ "value method breakpoint"
+
+ set bp_location [gdb_get_line_number \
+ "set breakpoint on a line with no real code"]
+ gdb_test "break ${testfile}.cc:${bp_location}" \
+ "Breakpoint.*at.* file .*${testfile}.cc, line.*(2 locations).*" \
+ "breakpoint on a line with no real code"
+ delete_breakpoints
+}
+
+#
+# Test calling of template methods.
+#
+
+proc test_template_calls {} {
+ global gdb_prompt
+ global hp_aCC_compiler
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return
+ }
+
+ if {!$hp_aCC_compiler} {setup_xfail hppa*-*-*}
+ gdb_test_multiple "print t5i.value()" "print t5i.value()" {
+ -re ".* = 2\[\r\n\]*$gdb_prompt $" {
+ pass "print t5i.value()"
+ }
+ -re "Cannot invoke functions on this machine.*$gdb_prompt $" {
+ fail "print t5i.value()"
+ }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ xfail "print t5i.value"
+ }
+ }
+}
+
+proc test_template_typedef {} {
+
+ gdb_test "print intBazOne::baz" ".*baz\\(int, int\\)>" \
+ "print method of template typedef"
+
+ gdb_test "print intBazOne::~Baz" ".*~Baz(\\(\\))?>" \
+ "print destructor of template typedef"
+}
+
+proc do_tests {} {
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ # Change multiple-symbols to "ask" in order to get the multiple-choice
+ # menu when breaking on overloaded methods.
+ gdb_test_no_output "set multiple-symbols ask"
+
+ runto_main
+
+ test_ptype_of_templates
+ test_template_breakpoints
+ test_template_typedef
+
+ if [ runto_main] {
+ test_template_calls
+ }
+}
+
+do_tests
+
+
+# More tests for different kinds of template parameters,
+# templates with partial specializations, nested templates, etc.
+# These have been tested only with HP aCC. They probably won't
+# work with other compilers because of differences in mangling
+# schemes.
+# Added by Satish Pai 1997-09-25
+# As of 2000-06-03, C++ support has been improved to the point that g++ can
+# pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb
+
+# I don't know how HP could be passing these tests without this. They
+# weren't breakpointing past a point where the below expressions were
+# initialized in the actual source. - djb
+
+gdb_test "b 770" \
+ "Breakpoint .* at .*, line 770."
+
+gdb_test "c" \
+ "Continuing.*Breakpoint .*" \
+ "continue to line 770"
+
+gdb_test "print fint" \
+ "\\$\[0-9\]* = \\{x = 0, t = 0\\}"
+
+gdb_test "print fvpchar" \
+ "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}"
+
+# Template Foo
+
+# Neither stabs nor DWARF-2 contains type information about templates
+# (as opposed to instantiations of templates), so in those
+# circumstances we expect GDB to not find a symbol. HP has a debug
+# format that contains more info, though, so it's also correct to
+# print out template info. (This affects several subsequent tests as
+# well.)
+
+# NOTE: carlton/2003-02-26: However, because of a bug in the way GDB
+# handles nested types, we don't get this right in the DWARF-2 case.
+
+gdb_test_multiple "ptype Foo" "ptype Foo" {
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n$gdb_prompt $" {
+ pass "ptype Foo"
+ }
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" {
+ xfail "ptype Foo"
+ }
+ -re "type = class Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ # GCC 3.1, DWARF-2 output.
+ kfail "gdb/57" "ptype Foo"
+ }
+ -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" {
+ # GCC 2.95.3, stabs+ output.
+ pass "ptype Foo"
+ }
+}
+
+# -re "type = class Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo(int, int);\r\n\\}\r\n$gdb_prompt $"
+
+# ptype Foo
+
+gdb_test_multiple "ptype fint" "ptype fint" {
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fint"
+ }
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fint"
+ }
+}
+
+# ptype Foo
+
+gdb_test_multiple "ptype fchar" "ptype fchar" {
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char foo\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fchar"
+ }
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char foo\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fchar"
+ }
+}
+
+# ptype Foo
+
+gdb_test_multiple "ptype fvpchar" "ptype fvpchar" {
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fvpchar"
+ }
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype fvpchar"
+ }
+ -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" {
+ kfail "gdb/1512" "ptype fvpchar"
+ }
+}
+
+# print a function from Foo
+
+# This test is sensitive to whitespace matching, so we'll do it twice,
+# varying the spacing, because of PR gdb/33.
+
+gdb_test_multiple "print Foo::foo" "print Foo::foo" {
+ -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
+ pass "print Foo::foo"
+ }
+ -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" {
+ # This used to be a kfail gdb/33 and then kfail gdb/931.
+ fail "print Foo::foo"
+ }
+}
+
+gdb_test_multiple "print Foo::foo" "print Foo::foo" {
+ -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
+ pass "print Foo::foo"
+ }
+ -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" {
+ # This used to be a kfail gdb/33 and then kfail gdb/931.
+ fail "print Foo::foo"
+ }
+}
+
+# Template Bar
+
+# same as Foo for g++
+gdb_test_multiple "ptype Bar" "ptype Bar" {
+ -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar\r\n\[ \t\]*(class |)Bar\r\n$gdb_prompt $" {
+ pass "ptype Bar"
+ }
+ -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" {
+ xfail "ptype Bar"
+ }
+ -re "ptype Bar\r\ntype = class Bar {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.1, DWARF-2 output.
+ kfail "gdb/57" "ptype Bar"
+ }
+ -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $" {
+ # GCC 2.95.3, stabs+ output.
+ pass "ptype Bar"
+ }
+}
+
+
+# ptype Bar
+
+gdb_test_multiple "ptype bint" "ptype bint" {
+ -re "type = (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bint"
+ }
+ -re "type = (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bint"
+ }
+}
+
+# ptype Bar3)>
+
+gdb_test_multiple "ptype bint2" "ptype bint2" {
+ -re "type = (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bint2"
+ }
+ -re "type = (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bint2"
+ }
+}
+
+# Template Baz
+
+# Same as Foo, for g++
+gdb_test_multiple "ptype Baz" "ptype Baz" {
+ -re "type = template <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz\r\n\[ \t\]*(class |)Baz\r\n$gdb_prompt $" {
+ pass "ptype Baz"
+ }
+ -re "type = <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" {
+ xfail "ptype Baz"
+ }
+ -re "type = class Baz {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.1, DWARF-2 output.
+ kfail "gdb/57" "ptype Baz"
+ }
+ -re "type = class Baz {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.x, DWARF-2 output, running into gdb/57 and gdb/1512.
+ kfail "gdb/57" "ptype Baz"
+ }
+ -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $" {
+ # GCC 2.95.3, stabs+ output.
+ pass "ptype Baz"
+ }
+}
+
+
+# ptype Baz
+
+gdb_test_multiple "ptype bazint" "ptype bazint" {
+ -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bazint"
+ }
+ -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\).*;\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bazint"
+ }
+}
+
+# ptype Baz
+
+gdb_test_multiple "ptype bazint2" "ptype bazint2" {
+ -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bazint2"
+ }
+ -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype bazint2"
+ }
+}
+
+# Template Qux
+# Same as Foo for g++
+gdb_test_multiple "ptype Qux" "ptype Qux" {
+ -re "type = template <(class |)T, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux\r\n\[ \t\]*(class |)Qux\r\n$gdb_prompt $" {
+ pass "ptype Qux"
+ }
+ -re ".*type = template <(class |)T.*, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" {
+ pass "ptype Qux"
+ }
+ -re "type = class Qux {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.1, DWARF-2 output.
+ kfail "gdb/57" "ptype Qux"
+ }
+ -re "type = class Qux {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.x, DWARF-2 output; gdb/57 + gdb/1512.
+ kfail "gdb/57" "ptype Qux"
+ }
+ -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $" {
+ # GCC 2.95.3, stabs+ output.
+ pass "ptype Qux"
+ }
+}
+
+# pt Qux
+
+gdb_test_multiple "ptype quxint" "ptype quxint" {
+ -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype quxint"
+ }
+ -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype quxint"
+ }
+ -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype quxint"
+ }
+ -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ kfail "gdb/1512" "ptype quxint"
+ }
+}
+
+
+# Template Spec
+
+# Same as Foo for g++
+gdb_test_multiple "ptype Spec" "ptype Spec" {
+ -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec\r\n\[ \t\]*(class |)Spec\r\n$gdb_prompt $" {
+ pass "ptype Spec"
+ }
+ -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" {
+ xfail "ptype Spec"
+ }
+ -re "type = class Spec {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $" {
+ # GCC 3.1, DWARF-2 output.
+ kfail "gdb/57" "ptype Spec"
+ }
+ -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $" {
+ # GCC 2.95.3, stabs+ output.
+ pass "ptype Spec"
+ }
+}
+
+# pt Spec
+
+gdb_test_multiple "ptype siip" "ptype siip" {
+ -re "type = class Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype siip"
+ }
+ -re "type = class Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int ?\\*\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype siip"
+ }
+}
+
+# pt Garply
+
+gdb_test_multiple "ptype Garply" "ptype Garply" {
+ -re "type = class Garply \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype Garply"
+ }
+ -re "type = class Garply \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int garply\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype Garply"
+ }
+}
+
+# ptype of nested template name
+
+gdb_test_multiple "ptype Garply >" "ptype Garply >" {
+ -re "type = (class |)Garply > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply t;\r\n\r\n\[ \t\]*.*(class |)Garply garply\\(int, (class |)Garply\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype Garply