[Lldb-commits] [lldb] r363881 - [Process] Remove unused field from HistoryThread
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 19 14:33:45 PDT 2019
Author: xiaobai
Date: Wed Jun 19 14:33:44 2019
New Revision: 363881
URL: http://llvm.org/viewvc/llvm-project?rev=363881&view=rev
Log:
[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
Modified:
lldb/trunk/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp
lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h
lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp
lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp Wed Jun 19 14:33:44 2019
@@ -261,11 +261,8 @@ MainThreadCheckerRuntime::GetBacktracesF
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
Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp Wed Jun 19 14:33:44 2019
@@ -1030,10 +1030,8 @@ static void AddThreadsForPath(const std:
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());
Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp Wed Jun 19 14:33:44 2019
@@ -327,10 +327,7 @@ UndefinedBehaviorSanitizerRuntime::GetBa
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());
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Wed Jun 19 14:33:44 2019
@@ -552,7 +552,7 @@ ThreadSP AppleObjCRuntime::GetBacktraceT
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;
}
Modified: lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp (original)
+++ lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp Wed Jun 19 14:33:44 2019
@@ -136,8 +136,7 @@ static void CreateHistoryThreadFromValue
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;
Modified: lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp Wed Jun 19 14:33:44 2019
@@ -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));
Modified: lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h Wed Jun 19 14:33:44 2019
@@ -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;
Modified: lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp Wed Jun 19 14:33:44 2019
@@ -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
Modified: lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h Wed Jun 19 14:33:44 2019
@@ -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
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp?rev=363881&r1=363880&r2=363881&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp Wed Jun 19 14:33:44 2019
@@ -485,12 +485,8 @@ ThreadSP SystemRuntimeMacOSX::GetExtende
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::GetExtendedBacktrac
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::GetExtendedBacktrac
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());
More information about the lldb-commits
mailing list