mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 04:50:08 +03: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:
parent
eeddbb6fa6
commit
8c7b393939
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/0GreenClover0 Commit: https://github.com/SerenityOS/serenity/commit/8c7b393939 Pull-request: https://github.com/SerenityOS/serenity/pull/21762
@ -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 };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user