[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- SBQueue.cpp -------------------------------------------------------===//
|
2013-12-13 08:29:16 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// 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
|
2013-12-13 08:29:16 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-03-09 00:22:55 +08:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
#include "SBReproducerPrivate.h"
|
2013-12-13 08:29:16 +08:00
|
|
|
#include "lldb/API/SBQueue.h"
|
|
|
|
|
|
|
|
#include "lldb/API/SBProcess.h"
|
2014-04-25 08:01:15 +08:00
|
|
|
#include "lldb/API/SBQueueItem.h"
|
2013-12-13 08:29:16 +08:00
|
|
|
#include "lldb/API/SBThread.h"
|
2014-04-25 08:01:15 +08:00
|
|
|
|
2013-12-13 08:29:16 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
|
|
|
#include "lldb/Target/Queue.h"
|
|
|
|
#include "lldb/Target/QueueItem.h"
|
|
|
|
#include "lldb/Target/Thread.h"
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
namespace lldb_private {
|
|
|
|
|
|
|
|
class QueueImpl {
|
2016-09-07 04:57:50 +08:00
|
|
|
public:
|
2013-12-14 09:14:45 +08:00
|
|
|
QueueImpl()
|
|
|
|
: m_queue_wp(), m_threads(), m_thread_list_fetched(false),
|
|
|
|
m_pending_items(), m_pending_items_fetched(false) {}
|
|
|
|
|
|
|
|
QueueImpl(const lldb::QueueSP &queue_sp)
|
|
|
|
: m_queue_wp(), m_threads(), m_thread_list_fetched(false),
|
|
|
|
m_pending_items(), m_pending_items_fetched(false) {
|
|
|
|
m_queue_wp = queue_sp;
|
|
|
|
}
|
2014-03-10 03:41:30 +08:00
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
QueueImpl(const QueueImpl &rhs) {
|
2014-02-05 13:44:54 +08:00
|
|
|
if (&rhs == this)
|
2016-09-07 04:57:50 +08:00
|
|
|
return;
|
2013-12-14 09:14:45 +08:00
|
|
|
m_queue_wp = rhs.m_queue_wp;
|
|
|
|
m_threads = rhs.m_threads;
|
2014-02-05 13:44:54 +08:00
|
|
|
m_thread_list_fetched = rhs.m_thread_list_fetched;
|
|
|
|
m_pending_items = rhs.m_pending_items;
|
|
|
|
m_pending_items_fetched = rhs.m_pending_items_fetched;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2020-02-18 14:57:06 +08:00
|
|
|
~QueueImpl() = default;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
2019-05-23 19:14:47 +08:00
|
|
|
bool IsValid() { return m_queue_wp.lock() != nullptr; }
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
void Clear() {
|
2013-12-14 09:14:45 +08:00
|
|
|
m_queue_wp.reset();
|
|
|
|
m_thread_list_fetched = false;
|
|
|
|
m_threads.clear();
|
2014-02-05 13:44:54 +08:00
|
|
|
m_pending_items_fetched = false;
|
|
|
|
m_pending_items.clear();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
void SetQueue(const lldb::QueueSP &queue_sp) {
|
2016-09-07 04:57:50 +08:00
|
|
|
Clear();
|
2013-12-18 08:58:23 +08:00
|
|
|
m_queue_wp = queue_sp;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
lldb::queue_id_t GetQueueID() const {
|
2013-12-14 09:14:45 +08:00
|
|
|
lldb::queue_id_t result = LLDB_INVALID_QUEUE_ID;
|
2014-03-10 03:41:30 +08:00
|
|
|
lldb::QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp) {
|
|
|
|
result = queue_sp->GetID();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
uint32_t GetIndexID() const {
|
2014-03-10 03:41:30 +08:00
|
|
|
uint32_t result = LLDB_INVALID_INDEX32;
|
|
|
|
lldb::QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp) {
|
|
|
|
result = queue_sp->GetIndexID();
|
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
const char *GetName() const {
|
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
2019-05-23 19:14:47 +08:00
|
|
|
const char *name = nullptr;
|
2013-12-14 09:14:45 +08:00
|
|
|
lldb::QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp.get()) {
|
|
|
|
name = queue_sp->GetName();
|
|
|
|
}
|
|
|
|
return name;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
void FetchThreads() {
|
2018-12-15 08:15:33 +08:00
|
|
|
if (!m_thread_list_fetched) {
|
2014-02-05 13:44:54 +08:00
|
|
|
lldb::QueueSP queue_sp = m_queue_wp.lock();
|
2013-12-14 09:14:45 +08:00
|
|
|
if (queue_sp) {
|
|
|
|
Process::StopLocker stop_locker;
|
2014-02-05 13:44:54 +08:00
|
|
|
if (stop_locker.TryLock(&queue_sp->GetProcess()->GetRunLock())) {
|
|
|
|
const std::vector<ThreadSP> thread_list(queue_sp->GetThreads());
|
2013-12-14 09:14:45 +08:00
|
|
|
m_thread_list_fetched = true;
|
2014-02-05 13:44:54 +08:00
|
|
|
const uint32_t num_threads = thread_list.size();
|
|
|
|
for (uint32_t idx = 0; idx < num_threads; ++idx) {
|
|
|
|
ThreadSP thread_sp = thread_list[idx];
|
2013-12-14 09:14:45 +08:00
|
|
|
if (thread_sp && thread_sp->IsValid()) {
|
|
|
|
m_threads.push_back(thread_sp);
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-10 03:41:30 +08:00
|
|
|
void FetchItems() {
|
2018-12-15 08:15:33 +08:00
|
|
|
if (!m_pending_items_fetched) {
|
2014-03-10 03:41:30 +08:00
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp) {
|
2013-12-14 09:14:45 +08:00
|
|
|
Process::StopLocker stop_locker;
|
|
|
|
if (stop_locker.TryLock(&queue_sp->GetProcess()->GetRunLock())) {
|
2014-02-05 13:44:54 +08:00
|
|
|
const std::vector<QueueItemSP> queue_items(
|
|
|
|
queue_sp->GetPendingItems());
|
|
|
|
m_pending_items_fetched = true;
|
2013-12-14 09:14:45 +08:00
|
|
|
const uint32_t num_pending_items = queue_items.size();
|
2014-02-05 13:44:54 +08:00
|
|
|
for (uint32_t idx = 0; idx < num_pending_items; ++idx) {
|
2013-12-14 09:14:45 +08:00
|
|
|
QueueItemSP item = queue_items[idx];
|
|
|
|
if (item && item->IsValid()) {
|
2014-02-05 13:44:54 +08:00
|
|
|
m_pending_items.push_back(item);
|
2013-12-14 09:14:45 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-13 10:54:54 +08:00
|
|
|
uint32_t GetNumThreads() {
|
|
|
|
uint32_t result = 0;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
FetchThreads();
|
|
|
|
if (m_thread_list_fetched) {
|
|
|
|
result = m_threads.size();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-13 10:54:54 +08:00
|
|
|
lldb::SBThread GetThreadAtIndex(uint32_t idx) {
|
2013-12-14 09:14:45 +08:00
|
|
|
FetchThreads();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:54:54 +08:00
|
|
|
SBThread sb_thread;
|
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp && idx < m_threads.size()) {
|
|
|
|
ProcessSP process_sp = queue_sp->GetProcess();
|
2013-12-14 09:14:45 +08:00
|
|
|
if (process_sp) {
|
|
|
|
ThreadSP thread_sp = m_threads[idx].lock();
|
|
|
|
if (thread_sp) {
|
2014-03-13 10:54:54 +08:00
|
|
|
sb_thread.SetThread(thread_sp);
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return sb_thread;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
uint32_t GetNumPendingItems() {
|
2013-12-14 09:14:45 +08:00
|
|
|
uint32_t result = 0;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
2018-12-15 08:15:33 +08:00
|
|
|
if (!m_pending_items_fetched && queue_sp) {
|
2014-03-10 03:41:30 +08:00
|
|
|
result = queue_sp->GetNumPendingWorkItems();
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2014-02-05 13:44:54 +08:00
|
|
|
result = m_pending_items.size();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-02-05 13:44:54 +08:00
|
|
|
lldb::SBQueueItem GetPendingItemAtIndex(uint32_t idx) {
|
2013-12-14 09:14:45 +08:00
|
|
|
SBQueueItem result;
|
|
|
|
FetchItems();
|
2014-02-05 13:44:54 +08:00
|
|
|
if (m_pending_items_fetched && idx < m_pending_items.size()) {
|
|
|
|
result.SetQueueItem(m_pending_items[idx]);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-10 03:41:30 +08:00
|
|
|
uint32_t GetNumRunningItems() {
|
2013-12-14 09:14:45 +08:00
|
|
|
uint32_t result = 0;
|
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp)
|
2014-03-10 03:41:30 +08:00
|
|
|
result = queue_sp->GetNumRunningWorkItems();
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
lldb::SBProcess GetProcess() {
|
|
|
|
SBProcess result;
|
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp) {
|
|
|
|
result.SetSP(queue_sp->GetProcess());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-12-14 09:14:45 +08:00
|
|
|
return result;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-03-13 10:54:54 +08:00
|
|
|
lldb::QueueKind GetKind() {
|
|
|
|
lldb::QueueKind kind = eQueueKindUnknown;
|
2013-12-14 09:14:45 +08:00
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp)
|
2014-03-08 09:34:55 +08:00
|
|
|
kind = queue_sp->GetKind();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
return kind;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
private:
|
|
|
|
lldb::QueueWP m_queue_wp;
|
|
|
|
std::vector<lldb::ThreadWP>
|
|
|
|
m_threads; // threads currently executing this queue's items
|
|
|
|
bool
|
|
|
|
m_thread_list_fetched; // have we tried to fetch the threads list already?
|
2014-02-05 13:44:54 +08:00
|
|
|
std::vector<lldb::QueueItemSP> m_pending_items; // items currently enqueued
|
|
|
|
bool m_pending_items_fetched; // have we tried to fetch the item list already?
|
2013-12-14 09:14:45 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
SBQueue::SBQueue() : m_opaque_sp(new QueueImpl()) {
|
|
|
|
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBQueue);
|
|
|
|
}
|
2013-12-13 08:29:16 +08:00
|
|
|
|
|
|
|
SBQueue::SBQueue(const QueueSP &queue_sp)
|
2019-03-06 08:06:00 +08:00
|
|
|
: m_opaque_sp(new QueueImpl(queue_sp)) {
|
|
|
|
LLDB_RECORD_CONSTRUCTOR(SBQueue, (const lldb::QueueSP &), queue_sp);
|
|
|
|
}
|
2013-12-13 08:29:16 +08:00
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
SBQueue::SBQueue(const SBQueue &rhs) {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_CONSTRUCTOR(SBQueue, (const lldb::SBQueue &), rhs);
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
if (&rhs == this)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_opaque_sp = rhs.m_opaque_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
const lldb::SBQueue &SBQueue::operator=(const lldb::SBQueue &rhs) {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD(const lldb::SBQueue &,
|
|
|
|
SBQueue, operator=,(const lldb::SBQueue &), rhs);
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
m_opaque_sp = rhs.m_opaque_sp;
|
2019-04-04 05:31:22 +08:00
|
|
|
return LLDB_RECORD_RESULT(*this);
|
2013-12-14 09:14:45 +08:00
|
|
|
}
|
|
|
|
|
2020-02-18 14:57:06 +08:00
|
|
|
SBQueue::~SBQueue() = default;
|
2013-12-13 08:29:16 +08:00
|
|
|
|
|
|
|
bool SBQueue::IsValid() const {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueue, IsValid);
|
Add "operator bool" to SB APIs
Summary:
Our python version of the SB API has (the python equivalent of)
operator bool, but the C++ version doesn't.
This is because our python operators are added by modify-python-lldb.py,
which performs postprocessing on the swig-generated interface files.
In this patch, I add the "operator bool" to all SB classes which have an
IsValid method (which is the same logic used by modify-python-lldb.py).
This way, we make the two interfaces more constent, and it allows us to
rely on swig's automatic syntesis of python __nonzero__ methods instead
of doing manual fixups.
Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D58792
llvm-svn: 355824
2019-03-11 21:58:46 +08:00
|
|
|
return this->operator bool();
|
|
|
|
}
|
|
|
|
SBQueue::operator bool() const {
|
|
|
|
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueue, operator bool);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->IsValid();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void SBQueue::Clear() {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(void, SBQueue, Clear);
|
|
|
|
|
2013-12-14 09:14:45 +08:00
|
|
|
m_opaque_sp->Clear();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void SBQueue::SetQueue(const QueueSP &queue_sp) {
|
2013-12-14 09:14:45 +08:00
|
|
|
m_opaque_sp->SetQueue(queue_sp);
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
lldb::queue_id_t SBQueue::GetQueueID() const {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::queue_id_t, SBQueue, GetQueueID);
|
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->GetQueueID();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t SBQueue::GetIndexID() const {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBQueue, GetIndexID);
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
uint32_t index_id = m_opaque_sp->GetIndexID();
|
|
|
|
return index_id;
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *SBQueue::GetName() const {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBQueue, GetName);
|
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->GetName();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t SBQueue::GetNumThreads() {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumThreads);
|
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->GetNumThreads();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SBThread SBQueue::GetThreadAtIndex(uint32_t idx) {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD(lldb::SBThread, SBQueue, GetThreadAtIndex, (uint32_t),
|
|
|
|
idx);
|
|
|
|
|
2014-03-08 09:34:55 +08:00
|
|
|
SBThread th = m_opaque_sp->GetThreadAtIndex(idx);
|
2019-03-06 08:06:00 +08:00
|
|
|
return LLDB_RECORD_RESULT(th);
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
2014-02-05 13:44:54 +08:00
|
|
|
uint32_t SBQueue::GetNumPendingItems() {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumPendingItems);
|
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->GetNumPendingItems();
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
2014-02-05 13:44:54 +08:00
|
|
|
SBQueueItem SBQueue::GetPendingItemAtIndex(uint32_t idx) {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD(lldb::SBQueueItem, SBQueue, GetPendingItemAtIndex,
|
|
|
|
(uint32_t), idx);
|
|
|
|
|
|
|
|
return LLDB_RECORD_RESULT(m_opaque_sp->GetPendingItemAtIndex(idx));
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
2014-03-10 03:41:30 +08:00
|
|
|
uint32_t SBQueue::GetNumRunningItems() {
|
2019-03-06 08:06:00 +08:00
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumRunningItems);
|
|
|
|
|
2019-03-08 06:47:13 +08:00
|
|
|
return m_opaque_sp->GetNumRunningItems();
|
2014-03-10 03:41:30 +08:00
|
|
|
}
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
SBProcess SBQueue::GetProcess() {
|
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBProcess, SBQueue, GetProcess);
|
2014-03-13 10:54:54 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
return LLDB_RECORD_RESULT(m_opaque_sp->GetProcess());
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::QueueKind SBQueue::GetKind() {
|
|
|
|
LLDB_RECORD_METHOD_NO_ARGS(lldb::QueueKind, SBQueue, GetKind);
|
|
|
|
|
|
|
|
return m_opaque_sp->GetKind();
|
|
|
|
}
|
2019-03-20 01:13:13 +08:00
|
|
|
|
|
|
|
namespace lldb_private {
|
|
|
|
namespace repro {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void RegisterMethods<SBQueue>(Registry &R) {
|
|
|
|
LLDB_REGISTER_CONSTRUCTOR(SBQueue, ());
|
|
|
|
LLDB_REGISTER_CONSTRUCTOR(SBQueue, (const lldb::QueueSP &));
|
|
|
|
LLDB_REGISTER_CONSTRUCTOR(SBQueue, (const lldb::SBQueue &));
|
|
|
|
LLDB_REGISTER_METHOD(const lldb::SBQueue &,
|
|
|
|
SBQueue, operator=,(const lldb::SBQueue &));
|
|
|
|
LLDB_REGISTER_METHOD_CONST(bool, SBQueue, IsValid, ());
|
|
|
|
LLDB_REGISTER_METHOD_CONST(bool, SBQueue, operator bool, ());
|
|
|
|
LLDB_REGISTER_METHOD(void, SBQueue, Clear, ());
|
|
|
|
LLDB_REGISTER_METHOD_CONST(lldb::queue_id_t, SBQueue, GetQueueID, ());
|
|
|
|
LLDB_REGISTER_METHOD_CONST(uint32_t, SBQueue, GetIndexID, ());
|
|
|
|
LLDB_REGISTER_METHOD_CONST(const char *, SBQueue, GetName, ());
|
|
|
|
LLDB_REGISTER_METHOD(uint32_t, SBQueue, GetNumThreads, ());
|
|
|
|
LLDB_REGISTER_METHOD(lldb::SBThread, SBQueue, GetThreadAtIndex, (uint32_t));
|
|
|
|
LLDB_REGISTER_METHOD(uint32_t, SBQueue, GetNumPendingItems, ());
|
|
|
|
LLDB_REGISTER_METHOD(lldb::SBQueueItem, SBQueue, GetPendingItemAtIndex,
|
|
|
|
(uint32_t));
|
|
|
|
LLDB_REGISTER_METHOD(uint32_t, SBQueue, GetNumRunningItems, ());
|
|
|
|
LLDB_REGISTER_METHOD(lldb::SBProcess, SBQueue, GetProcess, ());
|
|
|
|
LLDB_REGISTER_METHOD(lldb::QueueKind, SBQueue, GetKind, ());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|