Fix breakpoint condition that use member variables.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / breakpoint.exp
index d75e0f7bc2b96e091ec6ed2e67ed0ae6fc285690..57f2fd4d378c95f58ff9d2ff218cca075429b60b 100644 (file)
@@ -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
This page took 0.02369 seconds and 4 git commands to generate.