mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
HackStudio: Gracefully handle unfound source files
This commit is contained in:
@@ -609,13 +609,17 @@ int main(int argc, char** argv)
|
||||
dbg() << "Program stopped";
|
||||
|
||||
auto source_position = Debugger::the().session()->debug_info().get_source_position(regs.eip);
|
||||
ASSERT(source_position.has_value());
|
||||
if (!source_position.has_value()) {
|
||||
dbg() << "Could not find source position for address: " << (void*)regs.eip;
|
||||
return Debugger::HasControlPassedToUser::No;
|
||||
}
|
||||
current_editor_in_execution = get_editor_of_file(source_position.value().file_path);
|
||||
current_editor_in_execution->editor().set_execution_position(source_position.value().line_number - 1);
|
||||
debug_info_widget.update_variables(regs);
|
||||
continue_action->set_enabled(true);
|
||||
single_step_action->set_enabled(true);
|
||||
reveal_action_tab(debug_info_widget);
|
||||
return Debugger::HasControlPassedToUser::Yes;
|
||||
},
|
||||
[&]() {
|
||||
dbg() << "Program continued";
|
||||
|
||||
Reference in New Issue
Block a user