diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
commit | f73363f1dd94996356cefbf24388f561891acf0b (patch) | |
tree | e3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | |
parent | 160ee69dd7ae18978f4068116777639ea98dc951 (diff) |
Notes
Diffstat (limited to 'source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp')
-rw-r--r-- | source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 27dd03bfc7bc5..a525c16b9f135 100644 --- a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -24,7 +24,7 @@ #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" -#include "Utility/StringExtractorGDBRemote.h" +#include "lldb/Utility/StringExtractorGDBRemote.h" using namespace lldb; using namespace lldb_private; @@ -55,7 +55,7 @@ ThreadGDBRemote::~ThreadGDBRemote() { const char *ThreadGDBRemote::GetName() { if (m_thread_name.empty()) - return NULL; + return nullptr; return m_thread_name.c_str(); } @@ -80,10 +80,9 @@ void ThreadGDBRemote::SetQueueInfo(std::string &&queue_name, const char *ThreadGDBRemote::GetQueueName() { // If our cached queue info is valid, then someone called - // ThreadGDBRemote::SetQueueInfo(...) - // with valid information that was gleaned from the stop reply packet. In this - // case we trust - // that the info is valid in m_dispatch_queue_name without refetching it + // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned + // from the stop reply packet. In this case we trust that the info is valid + // in m_dispatch_queue_name without refetching it if (CachedQueueInfoIsValid()) { if (m_dispatch_queue_name.empty()) return nullptr; @@ -110,15 +109,14 @@ const char *ThreadGDBRemote::GetQueueName() { return m_dispatch_queue_name.c_str(); } } - return NULL; + return nullptr; } QueueKind ThreadGDBRemote::GetQueueKind() { // If our cached queue info is valid, then someone called - // ThreadGDBRemote::SetQueueInfo(...) - // with valid information that was gleaned from the stop reply packet. In this - // case we trust - // that the info is valid in m_dispatch_queue_name without refetching it + // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned + // from the stop reply packet. In this case we trust that the info is valid + // in m_dispatch_queue_name without refetching it if (CachedQueueInfoIsValid()) { return m_queue_kind; } @@ -141,10 +139,9 @@ QueueKind ThreadGDBRemote::GetQueueKind() { queue_id_t ThreadGDBRemote::GetQueueID() { // If our cached queue info is valid, then someone called - // ThreadGDBRemote::SetQueueInfo(...) - // with valid information that was gleaned from the stop reply packet. In this - // case we trust - // that the info is valid in m_dispatch_queue_name without refetching it + // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned + // from the stop reply packet. In this case we trust that the info is valid + // in m_dispatch_queue_name without refetching it if (CachedQueueInfoIsValid()) return m_queue_serial_number; @@ -275,11 +272,11 @@ void ThreadGDBRemote::RefreshStateAfterStop() { // Invalidate all registers in our register context. We don't set "force" to // true because the stop reply packet might have had some register values // that were expedited and these will already be copied into the register - // context by the time this function gets called. The GDBRemoteRegisterContext - // class has been made smart enough to detect when it needs to invalidate - // which registers are valid by putting hooks in the register read and - // register supply functions where they check the process stop ID and do - // the right thing. + // context by the time this function gets called. The + // GDBRemoteRegisterContext class has been made smart enough to detect when + // it needs to invalidate which registers are valid by putting hooks in the + // register read and register supply functions where they check the process + // stop ID and do the right thing. const bool force = false; GetRegisterContext()->InvalidateIfNeeded(force); } @@ -292,8 +289,8 @@ void ThreadGDBRemote::Dump(Log *log, uint32_t index) {} bool ThreadGDBRemote::ShouldStop(bool &step_more) { return true; } lldb::RegisterContextSP ThreadGDBRemote::GetRegisterContext() { - if (m_reg_context_sp.get() == NULL) - m_reg_context_sp = CreateRegisterContextForFrame(NULL); + if (!m_reg_context_sp) + m_reg_context_sp = CreateRegisterContextForFrame(nullptr); return m_reg_context_sp; } @@ -310,7 +307,8 @@ ThreadGDBRemote::CreateRegisterContextForFrame(StackFrame *frame) { if (process_sp) { ProcessGDBRemote *gdb_process = static_cast<ProcessGDBRemote *>(process_sp.get()); - // read_all_registers_at_once will be true if 'p' packet is not supported. + // read_all_registers_at_once will be true if 'p' packet is not + // supported. bool read_all_registers_at_once = !gdb_process->GetGDBRemote().GetpPacketSupported(GetID()); reg_ctx_sp.reset(new GDBRemoteRegisterContext( @@ -319,7 +317,7 @@ ThreadGDBRemote::CreateRegisterContextForFrame(StackFrame *frame) { } } else { Unwind *unwinder = GetUnwinder(); - if (unwinder) + if (unwinder != nullptr) reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame); } return reg_ctx_sp; |