Skip to content

Commit ded699a

Browse files
committed
Format
1 parent 33177f9 commit ded699a

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

lldb/include/lldb/API/SBTarget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class LLDB_API SBTarget {
6565

6666
static lldb::SBTarget GetTargetFromEvent(const lldb::SBEvent &event);
6767

68-
/// For eBroadcastBitNewTargetCreated events, returns the newly created target.
69-
/// For other event types, returns an invalid SBTarget.
68+
/// For eBroadcastBitNewTargetCreated events, returns the newly created
69+
/// target. For other event types, returns an invalid SBTarget.
7070
static lldb::SBTarget GetCreatedTargetFromEvent(const lldb::SBEvent &event);
7171

7272
static uint32_t GetNumModulesFromEvent(const lldb::SBEvent &event);

lldb/include/lldb/Target/Target.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ class Target : public std::enable_shared_from_this<Target>,
557557
TargetEventData(const lldb::TargetSP &target_sp,
558558
const ModuleList &module_list);
559559

560-
// Constructor for eBroadcastBitNewTargetCreated events. For this event type:
560+
// Constructor for eBroadcastBitNewTargetCreated events. For this event
561+
// type:
561562
// - target_sp is the parent target (the subject/broadcaster of the event)
562563
// - created_target_sp is the newly created target
563564
TargetEventData(const lldb::TargetSP &target_sp,
@@ -577,15 +578,17 @@ class Target : public std::enable_shared_from_this<Target>,
577578

578579
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
579580

580-
// For eBroadcastBitNewTargetCreated events, returns the newly created target.
581-
// For other event types, returns an invalid target.
581+
// For eBroadcastBitNewTargetCreated events, returns the newly created
582+
// target. For other event types, returns an invalid target.
582583
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
583584

584585
static ModuleList GetModuleListFromEvent(const Event *event_ptr);
585586

586587
const lldb::TargetSP &GetTarget() const { return m_target_sp; }
587588

588-
const lldb::TargetSP &GetCreatedTarget() const { return m_created_target_sp; }
589+
const lldb::TargetSP &GetCreatedTarget() const {
590+
return m_created_target_sp;
591+
}
589592

590593
const ModuleList &GetModuleList() const { return m_module_list; }
591594

lldb/source/Target/Target.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5204,10 +5204,10 @@ Target::TargetEventData::TargetEventData(const lldb::TargetSP &target_sp,
52045204
const ModuleList &module_list)
52055205
: EventData(), m_target_sp(target_sp), m_module_list(module_list) {}
52065206

5207-
Target::TargetEventData::TargetEventData(const lldb::TargetSP &target_sp,
5208-
const lldb::TargetSP &created_target_sp)
5209-
: EventData(), m_target_sp(target_sp), m_created_target_sp(created_target_sp),
5210-
m_module_list() {}
5207+
Target::TargetEventData::TargetEventData(
5208+
const lldb::TargetSP &target_sp, const lldb::TargetSP &created_target_sp)
5209+
: EventData(), m_target_sp(target_sp),
5210+
m_created_target_sp(created_target_sp), m_module_list() {}
52115211

52125212
Target::TargetEventData::~TargetEventData() = default;
52135213

lldb/tools/lldb-dap/DAPSessionManager.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
//===----------------------------------------------------------------------===//
88
///
99
/// \file
10-
/// This file contains the declarations of the DAPSessionManager and ManagedEventThread classes,
11-
/// which are used to multiple concurrent DAP sessions in a single lldb-dap process.
10+
/// This file contains the declarations of the DAPSessionManager and
11+
/// ManagedEventThread classes, which are used to multiple concurrent DAP
12+
/// sessions in a single lldb-dap process.
1213
///
1314
//===----------------------------------------------------------------------===//
1415

lldb/tools/lldb-dap/EventHelper.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include "lldb/API/SBEvent.h"
2424
#include "lldb/API/SBFileSpec.h"
2525
#include "lldb/API/SBListener.h"
26-
#include "lldb/API/SBStream.h"
2726
#include "lldb/API/SBPlatform.h"
27+
#include "lldb/API/SBStream.h"
2828
#include "llvm/Support/Error.h"
2929
#include "llvm/Support/FormatVariadic.h"
3030
#include "llvm/Support/Threading.h"
@@ -343,7 +343,7 @@ void EventThread(lldb::SBDebugger debugger, lldb::SBBroadcaster broadcaster,
343343
broadcaster.AddListener(listener, eBroadcastBitStopEventThread);
344344
debugger.GetBroadcaster().AddListener(
345345
listener, lldb::eBroadcastBitError | lldb::eBroadcastBitWarning);
346-
346+
347347
// listen for thread events.
348348
listener.StartListeningForEventClass(
349349
debugger, lldb::SBThread::GetBroadcasterClassName(),
@@ -434,7 +434,8 @@ void EventThread(lldb::SBDebugger debugger, lldb::SBBroadcaster broadcaster,
434434
event_mask & lldb::SBTarget::eBroadcastBitModulesUnloaded;
435435

436436
lldb::SBMutex api_mutex = dap_instance->GetAPIMutex();
437-
const std::scoped_lock<lldb::SBMutex, std::mutex> guard(api_mutex, dap_instance->modules_mutex);
437+
const std::scoped_lock<lldb::SBMutex, std::mutex> guard(api_mutex,
438+
dap_instance->modules_mutex);
438439
for (uint32_t i = 0; i < num_modules; ++i) {
439440
lldb::SBModule module =
440441
lldb::SBTarget::GetModuleAtIndexFromEvent(i, event);
@@ -471,25 +472,22 @@ void EventThread(lldb::SBDebugger debugger, lldb::SBBroadcaster broadcaster,
471472
// For NewTargetCreated events, GetTargetFromEvent returns the parent
472473
// target (the subject of the event), and GetCreatedTargetFromEvent
473474
// returns the newly created target.
474-
lldb::SBTarget target =
475-
lldb::SBTarget::GetTargetFromEvent(event);
475+
lldb::SBTarget target = lldb::SBTarget::GetTargetFromEvent(event);
476476
lldb::SBTarget created_target =
477477
lldb::SBTarget::GetCreatedTargetFromEvent(event);
478478

479479
if (!target.IsValid() || !created_target.IsValid()) {
480-
DAP_LOG(log,
481-
"Received NewTargetCreated event but parent or "
482-
"created target is invalid");
480+
DAP_LOG(log, "Received NewTargetCreated event but parent or "
481+
"created target is invalid");
483482
continue;
484483
}
485484

486485
// Find the DAP instance that spawned this target by looking up the
487486
// parent target.
488487
DAP *dap_instance = DAPSessionManager::FindDAP(target);
489488
if (!dap_instance) {
490-
DAP_LOG(log,
491-
"Received NewTargetCreated event but could not find "
492-
"DAP instance for target");
489+
DAP_LOG(log, "Received NewTargetCreated event but could not find "
490+
"DAP instance for target");
493491
continue;
494492
}
495493

0 commit comments

Comments
 (0)