Skip to content

Commit 770558b

Browse files
committed
Format
1 parent 58c7548 commit 770558b

File tree

5 files changed

+45
-34
lines changed

5 files changed

+45
-34
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,9 +1025,9 @@ Status ProcessGDBRemote::HandleConnectionRequest(const GPUActions &gpu_action) {
10251025
process_sp->GetTarget().shared_from_this());
10261026
LLDB_LOG(log, "ProcessGDBRemote::HandleConnectionRequest(): successfully "
10271027
"created process!!!");
1028-
auto event_sp = std::make_shared<Event>(
1029-
Target::eBroadcastBitNewTargetSpawned,
1030-
new Target::TargetEventData(gpu_target_sp));
1028+
auto event_sp =
1029+
std::make_shared<Event>(Target::eBroadcastBitNewTargetSpawned,
1030+
new Target::TargetEventData(gpu_target_sp));
10311031
GetTarget().BroadcastEvent(event_sp);
10321032
return Status();
10331033
}

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,15 +1624,19 @@ void DAP::EventThread() {
16241624
"startDebugging", std::move(start_debugging_args));
16251625
}
16261626
} else if (lldb::SBBreakpoint::EventIsBreakpointEvent(event)) {
1627-
lldb::SBBreakpoint bp = lldb::SBBreakpoint::GetBreakpointFromEvent(event);
1628-
if (!bp.IsValid()) continue;
1629-
1627+
lldb::SBBreakpoint bp =
1628+
lldb::SBBreakpoint::GetBreakpointFromEvent(event);
1629+
if (!bp.IsValid())
1630+
continue;
1631+
16301632
lldb::SBTarget event_target = bp.GetTarget();
1631-
1633+
16321634
// Find the DAP instance that owns this target
1633-
DAP* dap_instance = DAPSessionManager::GetInstance().FindDAPForTarget(event_target);
1634-
if (!dap_instance) continue;
1635-
1635+
DAP *dap_instance =
1636+
DAPSessionManager::GetInstance().FindDAPForTarget(event_target);
1637+
if (!dap_instance)
1638+
continue;
1639+
16361640
if (event_mask & lldb::SBTarget::eBroadcastBitBreakpointChanged) {
16371641
auto event_type =
16381642
lldb::SBBreakpoint::GetBreakpointEventTypeFromEvent(event);
@@ -1666,18 +1670,22 @@ void DAP::EventThread() {
16661670
} else if (event_mask & lldb::eBroadcastBitError ||
16671671
event_mask & lldb::eBroadcastBitWarning) {
16681672
// Global debugger events - send to all DAP instances
1669-
std::vector<DAP*> active_instances = DAPSessionManager::GetInstance().GetActiveSessions();
1670-
for (DAP* dap_instance : active_instances) {
1671-
if (!dap_instance) continue;
1672-
1673+
std::vector<DAP *> active_instances =
1674+
DAPSessionManager::GetInstance().GetActiveSessions();
1675+
for (DAP *dap_instance : active_instances) {
1676+
if (!dap_instance)
1677+
continue;
1678+
16731679
lldb::SBStructuredData data =
16741680
lldb::SBDebugger::GetDiagnosticFromEvent(event);
1675-
if (!data.IsValid()) continue;
1676-
1681+
if (!data.IsValid())
1682+
continue;
1683+
16771684
std::string type = GetStringValue(data.GetValueForKey("type"));
16781685
std::string message = GetStringValue(data.GetValueForKey("message"));
1679-
dap_instance->SendOutput(OutputType::Important,
1680-
llvm::formatv("{0}: {1}", type, message).str());
1686+
dap_instance->SendOutput(
1687+
OutputType::Important,
1688+
llvm::formatv("{0}: {1}", type, message).str());
16811689
}
16821690
} else if (event.BroadcasterMatchesRef(broadcaster)) {
16831691
if (event_mask & eBroadcastBitStopEventThread) {

lldb/tools/lldb-dap/DAP.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ using ClientFeature = protocol::ClientFeature;
6969
class DAPSessionManager {
7070
public:
7171
/// Get the singleton instance of the DAP session manager
72-
static DAPSessionManager& GetInstance();
72+
static DAPSessionManager &GetInstance();
7373

7474
/// Register a DAP session
75-
void RegisterSession(lldb::IOObjectSP io, DAP* dap);
75+
void RegisterSession(lldb::IOObjectSP io, DAP *dap);
7676

7777
/// Unregister a DAP session
7878
void UnregisterSession(lldb::IOObjectSP io);
7979

8080
/// Get all active DAP sessions
81-
std::vector<DAP*> GetActiveSessions();
81+
std::vector<DAP *> GetActiveSessions();
8282

8383
/// Disconnect all active sessions
8484
void DisconnectAllSessions();
@@ -93,10 +93,11 @@ class DAPSessionManager {
9393
std::optional<lldb::SBDebugger> GetSharedDebugger();
9494

9595
/// Get or create event thread for a specific debugger
96-
std::shared_ptr<std::thread> GetEventThreadForDebugger(lldb::SBDebugger debugger, DAP* requesting_dap);
96+
std::shared_ptr<std::thread>
97+
GetEventThreadForDebugger(lldb::SBDebugger debugger, DAP *requesting_dap);
9798

9899
/// Find the DAP instance that owns the given target
99-
DAP* FindDAPForTarget(lldb::SBTarget target);
100+
DAP *FindDAPForTarget(lldb::SBTarget target);
100101

101102
/// Clean up shared resources when the last session exits
102103
void CleanupSharedResources();
@@ -106,22 +107,23 @@ class DAPSessionManager {
106107
~DAPSessionManager() = default;
107108

108109
// Non-copyable and non-movable
109-
DAPSessionManager(const DAPSessionManager&) = delete;
110-
DAPSessionManager& operator=(const DAPSessionManager&) = delete;
111-
DAPSessionManager(DAPSessionManager&&) = delete;
112-
DAPSessionManager& operator=(DAPSessionManager&&) = delete;
110+
DAPSessionManager(const DAPSessionManager &) = delete;
111+
DAPSessionManager &operator=(const DAPSessionManager &) = delete;
112+
DAPSessionManager(DAPSessionManager &&) = delete;
113+
DAPSessionManager &operator=(DAPSessionManager &&) = delete;
113114

114115
std::mutex sessions_mutex_;
115116
std::condition_variable sessions_condition_;
116-
std::map<lldb::IOObjectSP, DAP*> active_sessions_;
117-
117+
std::map<lldb::IOObjectSP, DAP *> active_sessions_;
118+
118119
/// Optional shared debugger instance set when the native process
119120
/// spawns a new GPU target
120121
std::optional<lldb::SBDebugger> shared_debugger_;
121-
122+
122123
/// Map from debugger ID to its event thread used for when
123124
/// multiple DAP sessions are using the same debugger instance.
124-
std::map<lldb::user_id_t, std::shared_ptr<std::thread>> debugger_event_threads_;
125+
std::map<lldb::user_id_t, std::shared_ptr<std::thread>>
126+
debugger_event_threads_;
125127
};
126128

127129
enum class OutputType { Console, Important, Stdout, Stderr, Telemetry };
@@ -138,7 +140,7 @@ enum class ReplMode { Variable = 0, Command, Auto };
138140

139141
struct DAP {
140142
friend class DAPSessionManager;
141-
143+
142144
/// Path to the lldb-dap binary itself.
143145
static llvm::StringRef debug_adapter_path;
144146

lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ namespace lldb_dap {
2929
/// Since attaching is debugger/runtime specific, the arguments for this request
3030
/// are not part of this specification.
3131
Error AttachRequestHandler::Run(const AttachRequestArguments &args) const {
32-
// Initialize DAP debugger and related components if not sharing previously launched debugger.
32+
// Initialize DAP debugger and related components if not sharing previously
33+
// launched debugger.
3334
bool use_shared_debugger = args.targetIdx != UINT32_MAX;
3435
if (Error err = dap.InitializeDebugger(use_shared_debugger)) {
3536
return err;

lldb/tools/lldb-dap/Handler/LaunchRequestHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace lldb_dap {
2222

2323
/// Launch request; value of command field is 'launch'.
2424
Error LaunchRequestHandler::Run(const LaunchRequestArguments &arguments) const {
25-
// Initialize DAP debugger
25+
// Initialize DAP debugger
2626
if (Error err = dap.InitializeDebugger(false /* use_shared_debugger */)) {
2727
return err;
2828
}

0 commit comments

Comments
 (0)