[Process] Remove unused field from HistoryThread

Summary:
These fields are unused and have been since their inception, from what
I can tell.

Reviewers: compnerd, JDevlieghere, davide, labath

Subscribers: kubamracek, lldb-commits

Differential Revision: https://reviews.llvm.org/D63357

llvm-svn: 363881
This commit is contained in:
Alex Langford 2019-06-19 21:33:44 +00:00
parent 109d2ea153
commit 86df61cc93
10 changed files with 17 additions and 49 deletions

View File

@ -261,11 +261,8 @@ MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo(
StructuredData::ObjectSP thread_id_obj =
info->GetObjectForDotSeparatedPath("tid");
tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0;
uint32_t stop_id = 0;
bool stop_id_is_valid = false;
HistoryThread *history_thread =
new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid);
HistoryThread *history_thread = new HistoryThread(*process_sp, tid, PCs);
ThreadSP new_thread_sp(history_thread);
// Save this in the Process' ExtendedThreadList so a strong pointer retains

View File

@ -1030,10 +1030,8 @@ static void AddThreadsForPath(const std::string &path,
o->GetObjectForDotSeparatedPath("thread_os_id");
tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0;
uint32_t stop_id = 0;
bool stop_id_is_valid = false;
HistoryThread *history_thread =
new HistoryThread(*process_sp, tid, pcs, stop_id, stop_id_is_valid);
new HistoryThread(*process_sp, tid, pcs);
ThreadSP new_thread_sp(history_thread);
new_thread_sp->SetName(GenerateThreadName(path, o, info).c_str());

View File

@ -327,10 +327,7 @@ UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo(
info->GetObjectForDotSeparatedPath("tid");
tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0;
uint32_t stop_id = 0;
bool stop_id_is_valid = false;
HistoryThread *history_thread =
new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid);
HistoryThread *history_thread = new HistoryThread(*process_sp, tid, PCs);
ThreadSP new_thread_sp(history_thread);
std::string stop_reason_description = GetStopReasonDescription(info);
new_thread_sp->SetName(stop_reason_description.c_str());

View File

@ -552,7 +552,7 @@ ThreadSP AppleObjCRuntime::GetBacktraceThreadFromException(
if (pcs.empty()) return ThreadSP();
ThreadSP new_thread_sp(new HistoryThread(*m_process, 0, pcs, 0, false));
ThreadSP new_thread_sp(new HistoryThread(*m_process, 0, pcs));
m_process->GetExtendedThreadList().AddThread(new_thread_sp);
return new_thread_sp;
}

View File

@ -136,8 +136,7 @@ static void CreateHistoryThreadFromValueObject(ProcessSP process_sp,
pcs.push_back(pc);
}
HistoryThread *history_thread =
new HistoryThread(*process_sp, tid, pcs, 0, false);
HistoryThread *history_thread = new HistoryThread(*process_sp, tid, pcs);
ThreadSP new_thread_sp(history_thread);
std::ostringstream thread_name_with_number;
thread_name_with_number << thread_name << " Thread " << tid;

View File

@ -25,14 +25,12 @@ using namespace lldb_private;
// Constructor
HistoryThread::HistoryThread(lldb_private::Process &process, lldb::tid_t tid,
std::vector<lldb::addr_t> pcs, uint32_t stop_id,
bool stop_id_is_valid)
std::vector<lldb::addr_t> pcs)
: Thread(process, tid, true), m_framelist_mutex(), m_framelist(),
m_pcs(pcs), m_stop_id(stop_id), m_stop_id_is_valid(stop_id_is_valid),
m_extended_unwind_token(LLDB_INVALID_ADDRESS), m_queue_name(),
m_pcs(pcs), m_extended_unwind_token(LLDB_INVALID_ADDRESS), m_queue_name(),
m_thread_name(), m_originating_unique_thread_id(tid),
m_queue_id(LLDB_INVALID_QUEUE_ID) {
m_unwinder_up.reset(new HistoryUnwind(*this, pcs, stop_id_is_valid));
m_unwinder_up.reset(new HistoryUnwind(*this, pcs));
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
if (log)
log->Printf("%p HistoryThread::HistoryThread", static_cast<void *>(this));

View File

@ -27,15 +27,13 @@ namespace lldb_private {
/// process execution
///
/// This subclass of Thread is used to provide a backtrace from earlier in
/// process execution. It is given a backtrace list of pc addresses and
/// optionally a stop_id of when those pc addresses were collected, and it
/// process execution. It is given a backtrace list of pc addresses and it
/// will create stack frames for them.
class HistoryThread : public lldb_private::Thread {
public:
HistoryThread(lldb_private::Process &process, lldb::tid_t tid,
std::vector<lldb::addr_t> pcs, uint32_t stop_id,
bool stop_id_is_valid);
std::vector<lldb::addr_t> pcs);
~HistoryThread() override;
@ -80,8 +78,6 @@ protected:
mutable std::mutex m_framelist_mutex;
lldb::StackFrameListSP m_framelist;
std::vector<lldb::addr_t> m_pcs;
uint32_t m_stop_id;
bool m_stop_id_is_valid;
uint64_t m_extended_unwind_token;
std::string m_queue_name;

View File

@ -23,9 +23,8 @@ using namespace lldb_private;
// Constructor
HistoryUnwind::HistoryUnwind(Thread &thread, std::vector<lldb::addr_t> pcs,
bool stop_id_is_valid)
: Unwind(thread), m_pcs(pcs), m_stop_id_is_valid(stop_id_is_valid) {}
HistoryUnwind::HistoryUnwind(Thread &thread, std::vector<lldb::addr_t> pcs)
: Unwind(thread), m_pcs(pcs) {}
// Destructor
@ -34,7 +33,6 @@ HistoryUnwind::~HistoryUnwind() {}
void HistoryUnwind::DoClear() {
std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex);
m_pcs.clear();
m_stop_id_is_valid = false;
}
lldb::RegisterContextSP

View File

@ -18,8 +18,7 @@ namespace lldb_private {
class HistoryUnwind : public lldb_private::Unwind {
public:
HistoryUnwind(Thread &thread, std::vector<lldb::addr_t> pcs,
bool stop_id_is_valid);
HistoryUnwind(Thread &thread, std::vector<lldb::addr_t> pcs);
~HistoryUnwind() override;
@ -35,7 +34,6 @@ protected:
private:
std::vector<lldb::addr_t> m_pcs;
bool m_stop_id_is_valid;
};
} // namespace lldb_private

View File

@ -485,12 +485,8 @@ ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceThread(ThreadSP real_thread,
m_process->GetByteOrder(),
m_process->GetAddressByteSize());
ItemInfo item = ExtractItemInfoFromBuffer(extractor);
bool stop_id_is_valid = true;
if (item.stop_id == 0)
stop_id_is_valid = false;
originating_thread_sp = std::make_shared<HistoryThread>(
*m_process, item.enqueuing_thread_id, item.enqueuing_callstack,
item.stop_id, stop_id_is_valid);
*m_process, item.enqueuing_thread_id, item.enqueuing_callstack);
originating_thread_sp->SetExtendedBacktraceToken(
item.item_that_enqueued_this);
originating_thread_sp->SetQueueName(
@ -530,12 +526,8 @@ SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(lldb::addr_t item_ref) {
m_process->GetByteOrder(),
m_process->GetAddressByteSize());
ItemInfo item = ExtractItemInfoFromBuffer(extractor);
bool stop_id_is_valid = true;
if (item.stop_id == 0)
stop_id_is_valid = false;
return_thread_sp = std::make_shared<HistoryThread>(
*m_process, item.enqueuing_thread_id, item.enqueuing_callstack,
item.stop_id, stop_id_is_valid);
*m_process, item.enqueuing_thread_id, item.enqueuing_callstack);
return_thread_sp->SetExtendedBacktraceToken(item.item_that_enqueued_this);
return_thread_sp->SetQueueName(item.enqueuing_queue_label.c_str());
return_thread_sp->SetQueueID(item.enqueuing_queue_serialnum);
@ -556,14 +548,9 @@ SystemRuntimeMacOSX::GetExtendedBacktraceForQueueItem(QueueItemSP queue_item_sp,
if (type != "libdispatch")
return extended_thread_sp;
bool stop_id_is_valid = true;
if (queue_item_sp->GetStopID() == 0)
stop_id_is_valid = false;
extended_thread_sp = std::make_shared<HistoryThread>(
*m_process, queue_item_sp->GetEnqueueingThreadID(),
queue_item_sp->GetEnqueueingBacktrace(), queue_item_sp->GetStopID(),
stop_id_is_valid);
queue_item_sp->GetEnqueueingBacktrace());
extended_thread_sp->SetExtendedBacktraceToken(
queue_item_sp->GetItemThatEnqueuedThis());
extended_thread_sp->SetQueueName(queue_item_sp->GetQueueLabel().c_str());