gdb_test_no_output "set confirm off" "disable confirmation"
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 1"
gdb_breakpoint "increase_1"
gdb_test "continue" "Breakpoint .*at.*" "continue to the function to finish"
gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 2"
set cond_line [gdb_get_line_number "Condition Break."]
if ![runto_main] then {
gdb_test "python finishBP = SimpleFinishBreakpoint(gdb.newest_frame())" \
"SimpleFinishBreakpoint init" \
- "set finish breakpoint"
+ "set finish breakpoint for no debug symbol test"
gdb_test "continue" "SimpleFinishBreakpoint stop.*" "check FinishBreakpoint hit"
gdb_test "python print (finishBP.return_value)" "None" "check return value without debug symbol"
gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 3"
if ![runto call_longjmp_1] then {
perror "couldn't run to breakpoint call_longjmp"
gdb_test "python finishbp = SimpleFinishBreakpoint(gdb.newest_frame())" \
"SimpleFinishBreakpoint init" \
- "set finish breakpoint"
+ "set finish breakpoint for longjmp test"
gdb_test "break [gdb_get_line_number "after longjmp."]" "Breakpoint.* at .*" \
"set BP after the jump"
gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" \
gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 4"
if ![runto_main] then {
gdb_test "continue" \
"\"FinishBreakpoint\" cannot be set on a dummy frame.*" \
"don't allow FinishBreakpoint on dummy frames"
-gdb_test "print i" "8" "check stopped location"
+gdb_test "print i" "8" \
+ "check stopped location for stop in dummy frame case"
#
# Test FinishBreakpoint in BP condition evaluation
gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 5"
if ![runto_main] then {
fail "cannot run to main."
gdb_test "continue" "Continuing.*" "finish condition evaluation"
gdb_test "continue" "Breakpoint.*" "stop at conditional breakpoint"
-gdb_test "print i" "8" "check stopped location"
+gdb_test "print i" "8" \
+ "check stopped location for stop in normal frame case"
#
# Test FinishBreakpoint in explicit inferior function call
gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
- "import python scripts"
+ "import python scripts, 6"
if ![runto_main] then {
fail "cannot run to main."
# return address in dummy frame
gdb_test "python TestExplicitBreakpoint('increase_1')" "Breakpoint.*at.*" \
- "prepare TestExplicitBreakpoint"
+ "prepare TestExplicitBreakpoint, return addr in dummy frame"
gdb_test "print increase_1(&i)" \
"\"FinishBreakpoint\" cannot be set on a dummy frame.*" \
- "don't allow FinishBreakpoint on dummy frames"
+ "don't allow FinishBreakpoint on dummy frames, return address in dummy frame"
# return address in normal frame
delete_breakpoints
gdb_test "python TestExplicitBreakpoint(\"increase_1\")" "Breakpoint.*at.*" \
- "prepare TestExplicitBreakpoint"
+ "prepare TestExplicitBreakpoint, return addr in normal frame"
gdb_test "print increase(&i)" \
"SimpleFinishBreakpoint init.*SimpleFinishBreakpoint stop.*The program being debugged stopped while in a function called from GDB.*" \
"FinishBP stop at during explicit function call"