mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
HackStudio: Prevent crash when stepping through a program
The backtrace view expects that there is always a valid selection. This is not true when we execute a step in the debugger. Therefore we need to check if we have a valid selection in the on_selection_change handler.
This commit is contained in:
parent
ae8472f9ca
commit
a205633643
Notes:
sideshowbarker
2024-07-18 08:50:23 +09:00
Author: https://github.com/hieronymusma Commit: https://github.com/SerenityOS/serenity/commit/a205633643a Pull-request: https://github.com/SerenityOS/serenity/pull/8649
1 changed files with 5 additions and 1 deletions
|
@ -67,8 +67,12 @@ DebugInfoWidget::DebugInfoWidget()
|
||||||
|
|
||||||
m_backtrace_view->on_selection_change = [this] {
|
m_backtrace_view->on_selection_change = [this] {
|
||||||
const auto& index = m_backtrace_view->selection().first();
|
const auto& index = m_backtrace_view->selection().first();
|
||||||
auto& model = static_cast<BacktraceModel&>(*m_backtrace_view->model());
|
|
||||||
|
|
||||||
|
if (!index.is_valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& model = static_cast<BacktraceModel&>(*m_backtrace_view->model());
|
||||||
// Note: The reconstruction of the register set here is obviously incomplete.
|
// Note: The reconstruction of the register set here is obviously incomplete.
|
||||||
// We currently only reconstruct eip & ebp. Ideally would also reconstruct the other registers somehow.
|
// We currently only reconstruct eip & ebp. Ideally would also reconstruct the other registers somehow.
|
||||||
// (Other registers may be needed to get the values of variables who are not stored on the stack)
|
// (Other registers may be needed to get the values of variables who are not stored on the stack)
|
||||||
|
|
Loading…
Reference in a new issue