"be set on a dummy frame."));
}
else
- frame_id = get_frame_id (prev_frame);
+ /* Get the real calling frame ID, ignoring inline frames. */
+ frame_id = frame_unwind_caller_id (frame);
}
}
catch (const gdb_exception &except)
"check FinishBP not allowed in main"
}
+#
+# Test FinishBreakpoint returning to an inlined function
+#
+
+with_test_prefix "return to inlined function" {
+ clean_restart ${testfile}
+ gdb_load_shlib ${lib_sl}
+
+ gdb_test "source $python_file" "Python script imported.*" \
+ "import python scripts"
+
+ if {![runto_main]} {
+ return 0
+ }
+
+ gdb_breakpoint "increase_2"
+ gdb_test "continue" "Breakpoint .*at.*" "continue to the function to finish"
+
+ gdb_test "python finishbp_inline = MyFinishBreakpoint (gdb.parse_and_eval ('a'), gdb.newest_frame ())" \
+ "Temporary breakpoint.*" "set FinishBreakpoint returning to inlined frame"
+ gdb_test "continue" "MyFinishBreakpoint stop with.*return_value is: -8.*#0.*increase_inlined.*" \
+ "check MyFinishBreakpoint hit"
+ gdb_test "python print (finishbp_inline.return_value)" "-8.*" "check return_value"
+}
+
#
# Test FinishBreakpoint with no debug symbol
#