mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 13:35:03 +00:00
HackStudio: Create a progress bar update callback for each debug session
Instead of moving it out of the Debugger, which would lead to it being null when trying to create next debug sessions afterwards.
This commit is contained in:
committed by
Andreas Kling
parent
eeddbb6fa6
commit
8c7b393939
@@ -140,13 +140,24 @@ Debugger::CreateDebugSessionResult Debugger::create_debug_session()
|
||||
return m_child_setup_callback();
|
||||
return ErrorOr<void> {};
|
||||
};
|
||||
auto debug_session = Debug::DebugSession::exec_and_attach(m_executable_path, m_source_root, move(child_setup_callback), move(m_on_initialization_progress));
|
||||
|
||||
auto on_initialization_progress = [this](float progress) {
|
||||
if (m_on_initialization_progress)
|
||||
m_on_initialization_progress(progress);
|
||||
};
|
||||
|
||||
auto debug_session = Debug::DebugSession::exec_and_attach(m_executable_path, m_source_root, move(child_setup_callback), move(on_initialization_progress));
|
||||
VERIFY(!!debug_session);
|
||||
return { debug_session.release_nonnull(), Debug::DebugSession::Running };
|
||||
}
|
||||
|
||||
if (m_pid_to_attach.has_value()) {
|
||||
auto debug_session = Debug::DebugSession::attach(m_pid_to_attach.value(), m_source_root, move(m_on_initialization_progress));
|
||||
auto on_initialization_progress = [this](float progress) {
|
||||
if (m_on_initialization_progress)
|
||||
m_on_initialization_progress(progress);
|
||||
};
|
||||
|
||||
auto debug_session = Debug::DebugSession::attach(m_pid_to_attach.value(), m_source_root, move(on_initialization_progress));
|
||||
VERIFY(!!debug_session);
|
||||
return { debug_session.release_nonnull(), Debug::DebugSession::Stopped };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user