summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/breakpoint.exp
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-04-06 08:56:37 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-04-06 08:56:37 +0000
commita4c4910bfa928b322e14ec4b1d924692034dd75f (patch)
treed4f7e670adbd262bfd27b392f994c66ff0f24c4a /gdb/testsuite/gdb.cp/breakpoint.exp
parent8eb923c04760e86425b2dd86f6fd1c23b9404522 (diff)
downloadgdb-a4c4910bfa928b322e14ec4b1d924692034dd75f.tar.gz
Fix breakpoint condition that use member variables.
* valops.c (check_field): Remove. (check_field_in): Rename to check_field. (value_of_this): Use la_name_of_this. * value.h (check_field): Adjust prototype. * language.h (la_value_of_this): Rename to la_name_of_this. * language.c (unknown_language_defn): Specify "this" for name_of_this. (auto_language_defn): Likewise. (local_language_defn): Likewise. * ada-lang.c (ada_language_defn): Adjust comment. * c-lang.c (c_language_defn): Adjust comment. (cplus_language_defn): Specify "this" for name_of_this. (asm_language_defn): Adjust comment. (minimal_language_defn): Adjust comment. * f-lang.c (f_language_defn): Specify NULL for name_of_this. * jv-lang.c (java_language_defn): Specify "this" for name_of_this. * m2-lang.c (m2_language_defn): Specify "this" for name_of_this. * objc-lang.c (objc_language_defn): Specify "self" for name_of_this. * p-lang.c (pascal_language_defn): Specify "this" for name_of_this. * scm-lang.c (scm_language_defn): Specify NULL for name_of_this. * symtab.c (lookup_symbol_aux): Lookup "this" in the proper scope, and check for field in type of "this", without trying to create a value.
Diffstat (limited to 'gdb/testsuite/gdb.cp/breakpoint.exp')
-rw-r--r--gdb/testsuite/gdb.cp/breakpoint.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp
index d75e0f7bc2b..57f2fd4d378 100644
--- a/gdb/testsuite/gdb.cp/breakpoint.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint.exp
@@ -61,5 +61,15 @@ proc test_breakpoint {name} {
test_breakpoint "C1::Nested::foo"
+set bp_location1 [gdb_get_line_number "conditional breakpoint in method"]
+set bp_location2 [gdb_get_line_number "conditional breakpoint in method 2"]
+gdb_test "break $bp_location1 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method"
+gdb_test "break $bp_location2 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method 2"
+gdb_test "continue" ".*Breakpoint.*C1::foo.*" "continue to breakpoint"
+gdb_test "print i_" "\\\$1 = 3" "check the member variable"
+gdb_test "continue" ".*Breakpoint.*C1::bar.*" "continue to breakpoint"
+gdb_test "print i_" "\\\$2 = 3" "check the member variable"
+
+
gdb_exit
return 0