llvm-project/lldb/tools/lldb-dap/Handler/ConfigurationDoneRequestHandler.cpp
Muhammad Omair Javaid 2b8e806942 Revert "[lldb-dap] Add module symbol table viewer to VS Code extension #140626 (#153836)"
This reverts commit 8b64cd8be29da9ea74db5a1a21f7cd6e75f9e9d8.

This breaks lldb-aarch64-* bots causing a crash in lldb-dap while
running test TestDAP_moduleSymbols.py

https://lab.llvm.org/buildbot/#/builders/59/builds/22959
https://lab.llvm.org/buildbot/#/builders/141/builds/10975
2025-08-22 13:02:52 +05:00

66 lines
2.5 KiB
C++

//===-- ConfigurationDoneRequestHandler..cpp ------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "DAP.h"
#include "EventHelper.h"
#include "LLDBUtils.h"
#include "Protocol/ProtocolRequests.h"
#include "ProtocolUtils.h"
#include "RequestHandler.h"
#include "lldb/API/SBDebugger.h"
using namespace llvm;
using namespace lldb_dap::protocol;
namespace lldb_dap {
/// This request indicates that the client has finished initialization of the
/// debug adapter.
///
/// So it is the last request in the sequence of configuration requests (which
/// was started by the `initialized` event).
///
/// Clients should only call this request if the corresponding capability
/// `supportsConfigurationDoneRequest` is true.
llvm::Error
ConfigurationDoneRequestHandler::Run(const ConfigurationDoneArguments &) const {
dap.configuration_done = true;
// Ensure any command scripts did not leave us in an unexpected state.
lldb::SBProcess process = dap.target.GetProcess();
if (!process.IsValid() ||
!lldb::SBDebugger::StateIsStoppedState(process.GetState()))
return make_error<DAPError>(
"Expected process to be stopped.\r\n\r\nProcess is in an unexpected "
"state and may have missed an initial configuration. Please check that "
"any debugger command scripts are not resuming the process during the "
"launch sequence.");
// Waiting until 'configurationDone' to send target based capabilities in case
// the launch or attach scripts adjust the target. The initial dummy target
// may have different capabilities than the final target.
SendTargetBasedCapabilities(dap);
// Clients can request a baseline of currently existing threads after
// we acknowledge the configurationDone request.
// Client requests the baseline of currently existing threads after
// a successful or attach by sending a 'threads' request
// right after receiving the configurationDone response.
// Obtain the list of threads before we resume the process
dap.initial_thread_list = GetThreads(process, dap.thread_format);
SendProcessEvent(dap, dap.is_attach ? Attach : Launch);
if (dap.stop_at_entry)
return SendThreadStoppedEvent(dap, /*on_entry=*/true);
return ToError(process.Continue());
}
} // namespace lldb_dap