mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +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
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…
Add table
Add a link
Reference in a new issue