apolyakov created this revision.
apolyakov added reviewers: aprantl, clayborg.
The new member function allows to check if a target is dummy or real.
https://reviews.llvm.org/D48775
Files:
include/lldb/API/SBTarget.h
scripts/interface/SBTarget.i
source/API/SBTarget.cpp
Index: source/API/SBTarget.cpp
===================================================================
--- source/API/SBTarget.cpp
+++ source/API/SBTarget.cpp
@@ -146,6 +146,10 @@
return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid();
}
+bool SBTarget::IsDummy() const {
+ return *this == GetDebugger().GetDummyTarget();
+}
+
SBProcess SBTarget::GetProcess() {
SBProcess sb_process;
ProcessSP process_sp;
Index: scripts/interface/SBTarget.i
===================================================================
--- scripts/interface/SBTarget.i
+++ scripts/interface/SBTarget.i
@@ -81,6 +81,9 @@
bool
IsValid() const;
+ bool
+ IsDummy() const;
+
static bool
EventIsTargetEvent (const lldb::SBEvent &event);
Index: include/lldb/API/SBTarget.h
===================================================================
--- include/lldb/API/SBTarget.h
+++ include/lldb/API/SBTarget.h
@@ -62,6 +62,8 @@
bool IsValid() const;
+ bool IsDummy() const;
+
static bool EventIsTargetEvent(const lldb::SBEvent &event);
static lldb::SBTarget GetTargetFromEvent(const lldb::SBEvent &event);
Index: source/API/SBTarget.cpp
===================================================================
--- source/API/SBTarget.cpp
+++ source/API/SBTarget.cpp
@@ -146,6 +146,10 @@
return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid();
}
+bool SBTarget::IsDummy() const {
+ return *this == GetDebugger().GetDummyTarget();
+}
+
SBProcess SBTarget::GetProcess() {
SBProcess sb_process;
ProcessSP process_sp;
Index: scripts/interface/SBTarget.i
===================================================================
--- scripts/interface/SBTarget.i
+++ scripts/interface/SBTarget.i
@@ -81,6 +81,9 @@
bool
IsValid() const;
+ bool
+ IsDummy() const;
+
static bool
EventIsTargetEvent (const lldb::SBEvent &event);
Index: include/lldb/API/SBTarget.h
===================================================================
--- include/lldb/API/SBTarget.h
+++ include/lldb/API/SBTarget.h
@@ -62,6 +62,8 @@
bool IsValid() const;
+ bool IsDummy() const;
+
static bool EventIsTargetEvent(const lldb::SBEvent &event);
static lldb::SBTarget GetTargetFromEvent(const lldb::SBEvent &event);
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits