[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
This commit is contained in:
Konrad Kleine committed 2019-05-23 11:14:47 +00:00
1 parent 32d976bac1
commit 248a13057a
250 files changed
+1487 -1461

No files matched your search

@@ -209,7 +209,7 @@ protected:
const char *) = delete;
lldb::BreakpointLocationSP AddLocation(Address loc_addr,
bool *new_location = NULL);
bool *new_location = nullptr);
Breakpoint *m_breakpoint; // This is the breakpoint we add locations to.
lldb::addr_t m_offset; // A random offset the user asked us to add to any
+3 -3
View File
@@ -83,7 +83,7 @@ bool SBAddress::IsValid() const {
SBAddress::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBAddress, operator bool);
return m_opaque_up != NULL && m_opaque_up->IsValid();
return m_opaque_up != nullptr && m_opaque_up->IsValid();
}
void SBAddress::Clear() {
@@ -186,7 +186,7 @@ Address *SBAddress::operator->() { return m_opaque_up.get(); }
const Address *SBAddress::operator->() const { return m_opaque_up.get(); }
Address &SBAddress::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new Address());
return *m_opaque_up;
}
@@ -208,7 +208,7 @@ bool SBAddress::GetDescription(SBStream &description) {
// case there isn't one already...
Stream &strm = description.ref();
if (m_opaque_up->IsValid()) {
m_opaque_up->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
m_opaque_up->Dump(&strm, nullptr, Address::DumpStyleResolvedDescription,
Address::DumpStyleModuleWithFileAddress, 4);
StreamString sstrm;
// m_opaque_up->Dump (&sstrm, NULL,
+6 -6
View File
@@ -25,7 +25,7 @@
using namespace lldb;
using namespace lldb_private;
SBBlock::SBBlock() : m_opaque_ptr(NULL) {
SBBlock::SBBlock() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBlock);
}
@@ -44,7 +44,7 @@ const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
return LLDB_RECORD_RESULT(*this);
}
SBBlock::~SBBlock() { m_opaque_ptr = NULL; }
SBBlock::~SBBlock() { m_opaque_ptr = nullptr; }
bool SBBlock::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsValid);
@@ -53,14 +53,14 @@ bool SBBlock::IsValid() const {
SBBlock::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, operator bool);
return m_opaque_ptr != NULL;
return m_opaque_ptr != nullptr;
}
bool SBBlock::IsInlined() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsInlined);
if (m_opaque_ptr)
return m_opaque_ptr->GetInlinedFunctionInfo() != NULL;
return m_opaque_ptr->GetInlinedFunctionInfo() != nullptr;
return false;
}
@@ -77,10 +77,10 @@ const char *SBBlock::GetInlinedName() const {
language = function->GetLanguage();
else
language = lldb::eLanguageTypeUnknown;
return inlined_info->GetName(language).AsCString(NULL);
return inlined_info->GetName(language).AsCString(nullptr);
}
}
return NULL;
return nullptr;
}
SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
+3 -3
View File
@@ -179,7 +179,7 @@ const char *SBBreakpointLocation::GetCondition() {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetConditionText();
}
return NULL;
return nullptr;
}
void SBBreakpointLocation::SetAutoContinue(bool auto_continue) {
@@ -357,7 +357,7 @@ const char *SBBreakpointLocation::GetThreadName() const {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadName();
}
return NULL;
return nullptr;
}
void SBBreakpointLocation::SetQueueName(const char *queue_name) {
@@ -382,7 +382,7 @@ const char *SBBreakpointLocation::GetQueueName() const {
loc_sp->GetTarget().GetAPIMutex());
loc_sp->GetQueueName();
}
return NULL;
return nullptr;
}
bool SBBreakpointLocation::IsResolved() {
+9 -10
View File
@@ -16,20 +16,19 @@
using namespace lldb;
using namespace lldb_private;
SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) {
SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBroadcaster);
}
SBBroadcaster::SBBroadcaster(const char *name)
: m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) {
: m_opaque_sp(new Broadcaster(nullptr, name)), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR(SBBroadcaster, (const char *), name);
m_opaque_ptr = m_opaque_sp.get();
}
SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
: m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
}
: m_opaque_sp(owns ? broadcaster : nullptr), m_opaque_ptr(broadcaster) {}
SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
: m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) {
@@ -48,13 +47,13 @@ const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) {
return LLDB_RECORD_RESULT(*this);
}
SBBroadcaster::~SBBroadcaster() { reset(NULL, false); }
SBBroadcaster::~SBBroadcaster() { reset(nullptr, false); }
void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) {
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEventByType,
(uint32_t, bool), event_type, unique);
if (m_opaque_ptr == NULL)
if (m_opaque_ptr == nullptr)
return;
if (unique)
@@ -67,7 +66,7 @@ void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) {
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEvent,
(const lldb::SBEvent &, bool), event, unique);
if (m_opaque_ptr == NULL)
if (m_opaque_ptr == nullptr)
return;
EventSP event_sp = event.GetSP();
@@ -104,7 +103,7 @@ const char *SBBroadcaster::GetName() const {
if (m_opaque_ptr)
return m_opaque_ptr->GetBroadcasterName().GetCString();
return NULL;
return nullptr;
}
bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
@@ -144,14 +143,14 @@ bool SBBroadcaster::IsValid() const {
SBBroadcaster::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBroadcaster, operator bool);
return m_opaque_ptr != NULL;
return m_opaque_ptr != nullptr;
}
void SBBroadcaster::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBBroadcaster, Clear);
m_opaque_sp.reset();
m_opaque_ptr = NULL;
m_opaque_ptr = nullptr;
}
bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const {
+6 -6
View File
@@ -16,7 +16,7 @@
using namespace lldb;
using namespace lldb_private;
SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) {
SBCommunication::SBCommunication() : m_opaque(nullptr), m_opaque_owned(false) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommunication);
}
@@ -28,7 +28,7 @@ SBCommunication::SBCommunication(const char *broadcaster_name)
SBCommunication::~SBCommunication() {
if (m_opaque && m_opaque_owned)
delete m_opaque;
m_opaque = NULL;
m_opaque = nullptr;
m_opaque_owned = false;
}
@@ -39,7 +39,7 @@ bool SBCommunication::IsValid() const {
SBCommunication::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, operator bool);
return m_opaque != NULL;
return m_opaque != nullptr;
}
bool SBCommunication::GetCloseOnEOF() {
@@ -64,7 +64,7 @@ ConnectionStatus SBCommunication::Connect(const char *url) {
if (m_opaque) {
if (!m_opaque->HasConnection())
m_opaque->SetConnection(Host::CreateDefaultConnection(url).release());
return m_opaque->Connect(url, NULL);
return m_opaque->Connect(url, nullptr);
}
return eConnectionStatusNoConnection;
}
@@ -115,7 +115,7 @@ size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
? Timeout<std::micro>(llvm::None)
: std::chrono::microseconds(timeout_usec);
if (m_opaque)
bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL);
bytes_read = m_opaque->Read(dst, dst_len, timeout, status, nullptr);
else
status = eConnectionStatusNoConnection;
@@ -130,7 +130,7 @@ size_t SBCommunication::Write(const void *src, size_t src_len,
size_t bytes_written = 0;
if (m_opaque)
bytes_written = m_opaque->Write(src, src_len, status, NULL);
bytes_written = m_opaque->Write(src, src_len, status, nullptr);
else
status = eConnectionStatusNoConnection;
+5 -5
View File
@@ -20,7 +20,7 @@
using namespace lldb;
using namespace lldb_private;
SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) {
SBCompileUnit::SBCompileUnit() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCompileUnit);
}
@@ -41,7 +41,7 @@ const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) {
return LLDB_RECORD_RESULT(*this);
}
SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; }
SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = nullptr; }
SBFileSpec SBCompileUnit::GetFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBCompileUnit,
@@ -108,8 +108,8 @@ uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
file_spec = *m_opaque_ptr;
index = m_opaque_ptr->FindLineEntry(
start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL,
exact, NULL);
start_idx, line, inline_file_spec ? inline_file_spec->get() : nullptr,
exact, nullptr);
}
return index;
@@ -193,7 +193,7 @@ bool SBCompileUnit::IsValid() const {
SBCompileUnit::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCompileUnit, operator bool);
return m_opaque_ptr != NULL;
return m_opaque_ptr != nullptr;
}
bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const {
+5 -5
View File
@@ -64,7 +64,7 @@ bool SBData::IsValid() {
SBData::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBData, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
uint8_t SBData::GetAddressByteSize() {
@@ -312,13 +312,13 @@ const char *SBData::GetString(lldb::SBError &error, lldb::offset_t offset) {
LLDB_RECORD_METHOD(const char *, SBData, GetString,
(lldb::SBError &, lldb::offset_t), error, offset);
const char *value = 0;
const char *value = nullptr;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
} else {
uint32_t old_offset = offset;
value = m_opaque_sp->GetCStr(&offset);
if (offset == old_offset || (value == NULL))
if (offset == old_offset || (value == nullptr))
error.SetErrorString("unable to read data");
}
return value;
@@ -346,13 +346,13 @@ size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset,
(lldb::SBError &, lldb::offset_t, void *, size_t), error,
offset, buf, size);
void *ok = NULL;
void *ok = nullptr;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
} else {
uint32_t old_offset = offset;
ok = m_opaque_sp->GetU8(&offset, buf, size);
if ((offset == old_offset) || (ok == NULL))
if ((offset == old_offset) || (ok == nullptr))
error.SetErrorString("unable to read data");
}
return ok ? size : 0;
+1 -1
View File
@@ -147,7 +147,7 @@ const lldb_private::Declaration *SBDeclaration::operator->() const {
}
lldb_private::Declaration &SBDeclaration::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new lldb_private::Declaration());
return *m_opaque_up;
}
+5 -4
View File
@@ -41,7 +41,7 @@ const char *SBError::GetCString() const {
if (m_opaque_up)
return m_opaque_up->AsCString();
return NULL;
return nullptr;
}
void SBError::Clear() {
@@ -144,11 +144,11 @@ bool SBError::IsValid() const {
SBError::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, operator bool);
return m_opaque_up != NULL;
return m_opaque_up != nullptr;
}
void SBError::CreateIfNeeded() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new Status());
}
@@ -175,7 +175,8 @@ bool SBError::GetDescription(SBStream &description) {
description.Printf("success");
else {
const char *err_string = GetCString();
description.Printf("error: %s", (err_string != NULL ? err_string : ""));
description.Printf("error: %s",
(err_string != nullptr ? err_string : ""));
}
} else
description.Printf("error: <NULL>");
+3 -3
View File
@@ -22,7 +22,7 @@
using namespace lldb;
using namespace lldb_private;
SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(NULL) {
SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent);
}
@@ -69,7 +69,7 @@ const char *SBEvent::GetDataFlavor() {
if (event_data)
return lldb_event->GetData()->GetFlavor().AsCString();
}
return NULL;
return nullptr;
}
uint32_t SBEvent::GetType() const {
@@ -168,7 +168,7 @@ SBEvent::operator bool() const {
// Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get() accessor.
// See comments in SBEvent::get()....
return SBEvent::get() != NULL;
return SBEvent::get() != nullptr;
}
const char *SBEvent::GetCStringFromEvent(const SBEvent &event) {
+8 -8
View File
@@ -22,7 +22,7 @@
using namespace lldb;
using namespace lldb_private;
SBFunction::SBFunction() : m_opaque_ptr(NULL) {
SBFunction::SBFunction() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFunction);
}
@@ -42,7 +42,7 @@ const SBFunction &SBFunction::operator=(const SBFunction &rhs) {
return LLDB_RECORD_RESULT(*this);
}
SBFunction::~SBFunction() { m_opaque_ptr = NULL; }
SBFunction::~SBFunction() { m_opaque_ptr = nullptr; }
bool SBFunction::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, IsValid);
@@ -51,13 +51,13 @@ bool SBFunction::IsValid() const {
SBFunction::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, operator bool);
return m_opaque_ptr != NULL;
return m_opaque_ptr != nullptr;
}
const char *SBFunction::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetName);
const char *cstr = NULL;
const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetName().AsCString();
@@ -67,7 +67,7 @@ const char *SBFunction::GetName() const {
const char *SBFunction::GetDisplayName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetDisplayName);
const char *cstr = NULL;
const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled()
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
@@ -79,7 +79,7 @@ const char *SBFunction::GetDisplayName() const {
const char *SBFunction::GetMangledName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetMangledName);
const char *cstr = NULL;
const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
return cstr;
@@ -118,7 +118,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target) {
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBFunction, GetInstructions,
(lldb::SBTarget), target);
return LLDB_RECORD_RESULT(GetInstructions(target, NULL));
return LLDB_RECORD_RESULT(GetInstructions(target, nullptr));
}
SBInstructionList SBFunction::GetInstructions(SBTarget target,
@@ -141,7 +141,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target,
if (module_sp) {
const bool prefer_file_cache = false;
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
module_sp->GetArchitecture(), NULL, flavor, exe_ctx,
module_sp->GetArchitecture(), nullptr, flavor, exe_ctx,
m_opaque_ptr->GetAddressRange(), prefer_file_cache));
}
}
+3 -2
View File
@@ -107,8 +107,9 @@ lldb::thread_t SBHostOS::ThreadCreate(const char *name,
LLDB_RECORD_DUMMY(lldb::thread_t, SBHostOS, ThreadCreate,
(lldb::thread_func_t, void *, SBError *), name,
thread_function, thread_arg, error_ptr);
HostThread thread(ThreadLauncher::LaunchThread(
name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL));
HostThread thread(
ThreadLauncher::LaunchThread(name, thread_function, thread_arg,
error_ptr ? error_ptr->get() : nullptr));
return thread.Release();
}
+7 -6
View File
@@ -127,7 +127,7 @@ const char *SBInstruction::GetMnemonic(SBTarget target) {
}
return inst_sp->GetMnemonic(&exe_ctx);
}
return NULL;
return nullptr;
}
const char *SBInstruction::GetOperands(SBTarget target) {
@@ -147,7 +147,7 @@ const char *SBInstruction::GetOperands(SBTarget target) {
}
return inst_sp->GetOperands(&exe_ctx);
}
return NULL;
return nullptr;
}
const char *SBInstruction::GetComment(SBTarget target) {
@@ -167,7 +167,7 @@ const char *SBInstruction::GetComment(SBTarget target) {
}
return inst_sp->GetComment(&exe_ctx);
}
return NULL;
return nullptr;
}
size_t SBInstruction::GetByteSize() {
@@ -249,7 +249,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) {
// didn't have a stream already created, one will get created...
FormatEntity::Entry format;
FormatEntity::Parse("${addr}: ", format);
inst_sp->Dump(&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0);
inst_sp->Dump(&s.ref(), 0, true, false, nullptr, &sc, nullptr, &format, 0);
return true;
}
return false;
@@ -258,7 +258,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) {
void SBInstruction::Print(FILE *out) {
LLDB_RECORD_METHOD(void, SBInstruction, Print, (FILE *), out);
if (out == NULL)
if (out == nullptr)
return;
lldb::InstructionSP inst_sp(GetOpaque());
@@ -272,7 +272,8 @@ void SBInstruction::Print(FILE *out) {
StreamFile out_stream(out, false);
FormatEntity::Entry format;
FormatEntity::Parse("${addr}: ", format);
inst_sp->Dump(&out_stream, 0, true, false, NULL, &sc, NULL, &format, 0);
inst_sp->Dump(&out_stream, 0, true, false, nullptr, &sc, nullptr, &format,
0);
}
}
+4 -4
View File
@@ -49,7 +49,7 @@ bool SBInstructionList::IsValid() const {
SBInstructionList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBInstructionList, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
size_t SBInstructionList::GetSize() {
@@ -119,7 +119,7 @@ void SBInstructionList::SetDisassembler(const lldb::DisassemblerSP &opaque_sp) {
void SBInstructionList::Print(FILE *out) {
LLDB_RECORD_METHOD(void, SBInstructionList, Print, (FILE *), out);
if (out == NULL)
if (out == nullptr)
return;
}
@@ -142,7 +142,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) {
for (size_t i = 0; i < num_instructions; ++i) {
Instruction *inst =
m_opaque_sp->GetInstructionList().GetInstructionAtIndex(i).get();
if (inst == NULL)
if (inst == nullptr)
break;
const Address &addr = inst->GetAddress();
@@ -153,7 +153,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) {
addr, eSymbolContextEverything, sc);
}
inst->Dump(&sref, max_opcode_byte_size, true, false, NULL, &sc,
inst->Dump(&sref, max_opcode_byte_size, true, false, nullptr, &sc,
&prev_sc, &format, 0);
sref.EOL();
}
+1 -1
View File
@@ -162,7 +162,7 @@ const lldb_private::LineEntry *SBLineEntry::operator->() const {
}
lldb_private::LineEntry &SBLineEntry::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new lldb_private::LineEntry());
return *m_opaque_up;
}
+10 -10
View File
@@ -20,7 +20,7 @@
using namespace lldb;
using namespace lldb_private;
SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(NULL) {
SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener);
}
@@ -160,7 +160,7 @@ bool SBListener::WaitForEvent(uint32_t timeout_secs, SBEvent &event) {
}
if (!success)
event.reset(NULL);
event.reset(nullptr);
return success;
}
@@ -182,7 +182,7 @@ bool SBListener::WaitForEventForBroadcaster(uint32_t num_seconds,
return true;
}
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -205,7 +205,7 @@ bool SBListener::WaitForEventForBroadcasterWithType(
return true;
}
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -217,7 +217,7 @@ bool SBListener::PeekAtNextEvent(SBEvent &event) {
event.reset(m_opaque_sp->PeekAtNextEvent());
return event.IsValid();
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -231,7 +231,7 @@ bool SBListener::PeekAtNextEventForBroadcaster(const SBBroadcaster &broadcaster,
event.reset(m_opaque_sp->PeekAtNextEventForBroadcaster(broadcaster.get()));
return event.IsValid();
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -247,7 +247,7 @@ bool SBListener::PeekAtNextEventForBroadcasterWithType(
broadcaster.get(), event_type_mask));
return event.IsValid();
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -261,7 +261,7 @@ bool SBListener::GetNextEvent(SBEvent &event) {
return true;
}
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -279,7 +279,7 @@ bool SBListener::GetNextEventForBroadcaster(const SBBroadcaster &broadcaster,
return true;
}
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
@@ -299,7 +299,7 @@ bool SBListener::GetNextEventForBroadcasterWithType(
return true;
}
}
event.reset(NULL);
event.reset(nullptr);
return false;
}
+11 -12
View File
@@ -40,8 +40,8 @@ SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec);
ModuleSP module_sp;
Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_up,
module_sp, NULL, NULL, NULL);
Status error = ModuleList::GetSharedModule(
*module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr);
if (module_sp)
SetSP(module_sp);
}
@@ -85,7 +85,7 @@ bool SBModule::IsValid() const {
SBModule::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
void SBModule::Clear() {
@@ -159,7 +159,7 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
const uint8_t *SBModule::GetUUIDBytes() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes);
const uint8_t *uuid_bytes = NULL;
const uint8_t *uuid_bytes = nullptr;
ModuleSP module_sp(GetSP());
if (module_sp)
uuid_bytes = module_sp->GetUUID().GetBytes().data();
@@ -170,8 +170,7 @@ const uint8_t *SBModule::GetUUIDBytes() const {
const char *SBModule::GetUUIDString() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString);
const char *uuid_cstr = NULL;
const char *uuid_cstr = nullptr;
ModuleSP module_sp(GetSP());
if (module_sp) {
// We are going to return a "const char *" value through the public API, so
@@ -185,7 +184,7 @@ const char *SBModule::GetUUIDString() const {
return uuid_cstr;
}
return NULL;
return nullptr;
}
bool SBModule::operator==(const SBModule &rhs) const {
@@ -296,7 +295,7 @@ static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
if (symbols)
return symbols->GetSymtab();
}
return NULL;
return nullptr;
}
size_t SBModule::GetNumSymbols() {
@@ -410,7 +409,7 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name,
const bool symbols_ok = true;
const bool inlines_ok = true;
FunctionNameType type = static_cast<FunctionNameType>(name_type_mask);
module_sp->FindFunctions(ConstString(name), NULL, type, symbols_ok,
module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok,
inlines_ok, append, *sb_sc_list);
}
return LLDB_RECORD_RESULT(sb_sc_list);
@@ -427,7 +426,7 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name,
if (name && module_sp) {
VariableList variable_list;
const uint32_t match_count = module_sp->FindGlobalVariables(
ConstString(name), NULL, max_matches, variable_list);
ConstString(name), nullptr, max_matches, variable_list);
if (match_count > 0) {
for (uint32_t i = 0; i < match_count; ++i) {
@@ -558,7 +557,7 @@ lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) {
TypeClass type_class = static_cast<TypeClass>(type_mask);
TypeList type_list;
vendor->GetTypes(NULL, type_class, type_list);
vendor->GetTypes(nullptr, type_class, type_list);
sb_type_list.m_opaque_up->Append(type_list);
return LLDB_RECORD_RESULT(sb_type_list);
}
@@ -606,7 +605,7 @@ const char *SBModule::GetTriple() {
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
return NULL;
return nullptr;
}
uint32_t SBModule::GetAddressByteSize() {
+14 -14
View File
@@ -28,7 +28,7 @@ using namespace lldb_private;
// PlatformConnectOptions
struct PlatformConnectOptions {
PlatformConnectOptions(const char *url = NULL)
PlatformConnectOptions(const char *url = nullptr)
: m_url(), m_rsync_options(), m_rsync_remote_path_prefix(),
m_rsync_enabled(false), m_rsync_omit_hostname_from_remote_path(false),
m_local_cache_directory() {
@@ -48,7 +48,7 @@ struct PlatformConnectOptions {
// PlatformShellCommand
struct PlatformShellCommand {
PlatformShellCommand(const char *shell_command = NULL)
PlatformShellCommand(const char *shell_command = nullptr)
: m_command(), m_working_dir(), m_status(0), m_signo(0) {
if (shell_command && shell_command[0])
m_command = shell_command;
@@ -94,7 +94,7 @@ const char *SBPlatformConnectOptions::GetURL() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformConnectOptions, GetURL);
if (m_opaque_ptr->m_url.empty())
return NULL;
return nullptr;
return m_opaque_ptr->m_url.c_str();
}
@@ -188,7 +188,7 @@ const char *SBPlatformShellCommand::GetCommand() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetCommand);
if (m_opaque_ptr->m_command.empty())
return NULL;
return nullptr;
return m_opaque_ptr->m_command.c_str();
}
@@ -207,7 +207,7 @@ const char *SBPlatformShellCommand::GetWorkingDirectory() {
GetWorkingDirectory);
if (m_opaque_ptr->m_working_dir.empty())
return NULL;
return nullptr;
return m_opaque_ptr->m_working_dir.c_str();
}
@@ -256,7 +256,7 @@ const char *SBPlatformShellCommand::GetOutput() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetOutput);
if (m_opaque_ptr->m_output.empty())
return NULL;
return nullptr;
return m_opaque_ptr->m_output.c_str();
}
@@ -282,7 +282,7 @@ bool SBPlatform::IsValid() const {
SBPlatform::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBPlatform, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
void SBPlatform::Clear() {
@@ -297,7 +297,7 @@ const char *SBPlatform::GetName() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetName().GetCString();
return NULL;
return nullptr;
}
lldb::PlatformSP SBPlatform::GetSP() const { return m_opaque_sp; }
@@ -312,7 +312,7 @@ const char *SBPlatform::GetWorkingDirectory() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetWorkingDirectory().GetCString();
return NULL;
return nullptr;
}
bool SBPlatform::SetWorkingDirectory(const char *path) {
@@ -376,7 +376,7 @@ const char *SBPlatform::GetTriple() {
return ConstString(arch.GetTriple().getTriple().c_str()).GetCString();
}
}
return NULL;
return nullptr;
}
const char *SBPlatform::GetOSBuild() {
@@ -393,7 +393,7 @@ const char *SBPlatform::GetOSBuild() {
}
}
}
return NULL;
return nullptr;
}
const char *SBPlatform::GetOSDescription() {
@@ -410,7 +410,7 @@ const char *SBPlatform::GetOSDescription() {
}
}
}
return NULL;
return nullptr;
}
const char *SBPlatform::GetHostname() {
@@ -419,7 +419,7 @@ const char *SBPlatform::GetHostname() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetHostname();
return NULL;
return nullptr;
}
uint32_t SBPlatform::GetOSMajorVersion() {
@@ -513,7 +513,7 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) {
return Status("invalid shell command (empty)");
const char *working_dir = shell_command.GetWorkingDirectory();
if (working_dir == NULL) {
if (working_dir == nullptr) {
working_dir = platform_sp->GetWorkingDirectory().GetCString();
if (working_dir)
shell_command.SetWorkingDirectory(working_dir);
+5 -5
View File
@@ -335,7 +335,7 @@ void SBProcess::ReportEventState(const SBEvent &event, FILE *out) const {
LLDB_RECORD_METHOD_CONST(void, SBProcess, ReportEventState,
(const lldb::SBEvent &, FILE *), event, out);
if (out == NULL)
if (out == nullptr)
return;
ProcessSP process_sp(GetSP());
@@ -534,7 +534,7 @@ int SBProcess::GetExitStatus() {
const char *SBProcess::GetExitDescription() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBProcess, GetExitDescription);
const char *exit_desc = NULL;
const char *exit_desc = nullptr;
ProcessSP process_sp(GetSP());
if (process_sp) {
std::lock_guard<std::recursive_mutex> guard(
@@ -602,7 +602,7 @@ SBError SBProcess::Continue() {
if (process_sp->GetTarget().GetDebugger().GetAsyncExecution())
sb_error.ref() = process_sp->Resume();
else
sb_error.ref() = process_sp->ResumeSynchronous(NULL);
sb_error.ref() = process_sp->ResumeSynchronous(nullptr);
} else
sb_error.SetErrorString("SBProcess is invalid");
@@ -985,7 +985,7 @@ bool SBProcess::GetDescription(SBStream &description) {
char path[PATH_MAX];
GetTarget().GetExecutable().GetPath(path, sizeof(path));
Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer();
const char *exe_name = NULL;
const char *exe_name = nullptr;
if (exe_module)
exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
@@ -1156,7 +1156,7 @@ const char *SBProcess::GetExtendedBacktraceTypeAtIndex(uint32_t idx) {
return names[idx].AsCString();
}
}
return NULL;
return nullptr;
}
SBThreadCollection SBProcess::GetHistoryThreads(addr_t addr) {
+2 -2
View File
@@ -49,7 +49,7 @@ public:
~QueueImpl() {}
bool IsValid() { return m_queue_wp.lock() != NULL; }
bool IsValid() { return m_queue_wp.lock() != nullptr; }
void Clear() {
m_queue_wp.reset();
@@ -83,7 +83,7 @@ public:
}
const char *GetName() const {
const char *name = NULL;
const char *name = nullptr;
lldb::QueueSP queue_sp = m_queue_wp.lock();
if (queue_sp.get()) {
name = queue_sp->GetName();
+1 -1
View File
@@ -41,7 +41,7 @@ bool SBQueueItem::IsValid() const {
SBQueueItem::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueueItem, operator bool);
return m_queue_item_sp.get() != NULL;
return m_queue_item_sp.get() != nullptr;
}
void SBQueueItem::Clear() {
+2 -2
View File
@@ -54,7 +54,7 @@ SBSection::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSection, operator bool);
SectionSP section_sp(GetSP());
return section_sp && section_sp->GetModule().get() != NULL;
return section_sp && section_sp->GetModule().get() != nullptr;
}
const char *SBSection::GetName() {
@@ -63,7 +63,7 @@ const char *SBSection::GetName() {
SectionSP section_sp(GetSP());
if (section_sp)
return section_sp->GetName().GetCString();
return NULL;
return nullptr;
}
lldb::SBSection SBSection::GetParent() {
+1 -1
View File
@@ -131,7 +131,7 @@ size_t SBSourceManager::DisplaySourceLinesWithLineNumbersAndColumn(
const char *, lldb::SBStream &),
file, line, column, context_before, context_after, current_line_cstr, s);
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
return 0;
return m_opaque_up->DisplaySourceLinesWithLineNumbers(
+5 -5
View File
@@ -34,7 +34,7 @@ bool SBStream::IsValid() const {
SBStream::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStream, operator bool);
return (m_opaque_up != NULL);
return (m_opaque_up != nullptr);
}
// If this stream is not redirected to a file, it will maintain a local cache
@@ -42,8 +42,8 @@ SBStream::operator bool() const {
const char *SBStream::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBStream, GetData);
if (m_is_file || m_opaque_up == NULL)
return NULL;
if (m_is_file || m_opaque_up == nullptr)
return nullptr;
return static_cast<StreamString *>(m_opaque_up.get())->GetData();
}
@@ -53,7 +53,7 @@ const char *SBStream::GetData() {
size_t SBStream::GetSize() {
LLDB_RECORD_METHOD_NO_ARGS(size_t, SBStream, GetSize);
if (m_is_file || m_opaque_up == NULL)
if (m_is_file || m_opaque_up == nullptr)
return 0;
return static_cast<StreamString *>(m_opaque_up.get())->GetSize();
@@ -160,7 +160,7 @@ lldb_private::Stream *SBStream::operator->() { return m_opaque_up.get(); }
lldb_private::Stream *SBStream::get() { return m_opaque_up.get(); }
lldb_private::Stream &SBStream::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new StreamString());
return *m_opaque_up;
}
+5 -5
View File
@@ -56,13 +56,13 @@ bool SBStringList::IsValid() const {
SBStringList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStringList, operator bool);
return (m_opaque_up != NULL);
return (m_opaque_up != nullptr);
}
void SBStringList::AppendString(const char *str) {
LLDB_RECORD_METHOD(void, SBStringList, AppendString, (const char *), str);
if (str != NULL) {
if (str != nullptr) {
if (IsValid())
m_opaque_up->AppendString(str);
else
@@ -74,7 +74,7 @@ void SBStringList::AppendList(const char **strv, int strc) {
LLDB_RECORD_METHOD(void, SBStringList, AppendList, (const char **, int), strv,
strc);
if ((strv != NULL) && (strc > 0)) {
if ((strv != nullptr) && (strc > 0)) {
if (IsValid())
m_opaque_up->AppendList(strv, strc);
else
@@ -115,7 +115,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) {
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
return NULL;
return nullptr;
}
const char *SBStringList::GetStringAtIndex(size_t idx) const {
@@ -125,7 +125,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) const {
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
return NULL;
return nullptr;
}
void SBStringList::Clear() {
+9 -9
View File
@@ -18,7 +18,7 @@
using namespace lldb;
using namespace lldb_private;
SBSymbol::SBSymbol() : m_opaque_ptr(NULL) {
SBSymbol::SBSymbol() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSymbol);
}
@@ -37,7 +37,7 @@ const SBSymbol &SBSymbol::operator=(const SBSymbol &rhs) {
return LLDB_RECORD_RESULT(*this);
}
SBSymbol::~SBSymbol() { m_opaque_ptr = NULL; }
SBSymbol::~SBSymbol() { m_opaque_ptr = nullptr; }
void SBSymbol::SetSymbol(lldb_private::Symbol *lldb_object_ptr) {
m_opaque_ptr = lldb_object_ptr;
@@ -50,13 +50,13 @@ bool SBSymbol::IsValid() const {
SBSymbol::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbol, operator bool);
return m_opaque_ptr != NULL;
return m_opaque_ptr != nullptr;
}
const char *SBSymbol::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetName);
const char *name = NULL;
const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetName().AsCString();
@@ -66,7 +66,7 @@ const char *SBSymbol::GetName() const {
const char *SBSymbol::GetDisplayName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetDisplayName);
const char *name = NULL;
const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetMangled()
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
@@ -78,7 +78,7 @@ const char *SBSymbol::GetDisplayName() const {
const char *SBSymbol::GetMangledName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetMangledName);
const char *name = NULL;
const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
return name;
@@ -105,7 +105,7 @@ bool SBSymbol::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ptr) {
m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
} else
strm.PutCString("No value");
@@ -116,7 +116,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target) {
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBSymbol, GetInstructions,
(lldb::SBTarget), target);
return LLDB_RECORD_RESULT(GetInstructions(target, NULL));
return LLDB_RECORD_RESULT(GetInstructions(target, nullptr));
}
SBInstructionList SBSymbol::GetInstructions(SBTarget target,
@@ -141,7 +141,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target,
AddressRange symbol_range(symbol_addr, m_opaque_ptr->GetByteSize());
const bool prefer_file_cache = false;
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
module_sp->GetArchitecture(), NULL, flavor_string, exe_ctx,
module_sp->GetArchitecture(), nullptr, flavor_string, exe_ctx,
symbol_range, prefer_file_cache));
}
}
+9 -8
View File
@@ -63,7 +63,7 @@ bool SBSymbolContext::IsValid() const {
SBSymbolContext::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContext, operator bool);
return m_opaque_up != NULL;
return m_opaque_up != nullptr;
}
SBModule SBSymbolContext::GetModule() {
@@ -84,13 +84,13 @@ SBCompileUnit SBSymbolContext::GetCompileUnit() {
GetCompileUnit);
return LLDB_RECORD_RESULT(
SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : NULL));
SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : nullptr));
}
SBFunction SBSymbolContext::GetFunction() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFunction, SBSymbolContext, GetFunction);
Function *function = NULL;
Function *function = nullptr;
if (m_opaque_up)
function = m_opaque_up->function;
@@ -103,7 +103,8 @@ SBFunction SBSymbolContext::GetFunction() {
SBBlock SBSymbolContext::GetBlock() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBlock, SBSymbolContext, GetBlock);
return LLDB_RECORD_RESULT(SBBlock(m_opaque_up ? m_opaque_up->block : NULL));
return LLDB_RECORD_RESULT(
SBBlock(m_opaque_up ? m_opaque_up->block : nullptr));
}
SBLineEntry SBSymbolContext::GetLineEntry() {
@@ -119,7 +120,7 @@ SBLineEntry SBSymbolContext::GetLineEntry() {
SBSymbol SBSymbolContext::GetSymbol() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSymbol, SBSymbolContext, GetSymbol);
Symbol *symbol = NULL;
Symbol *symbol = nullptr;
if (m_opaque_up)
symbol = m_opaque_up->symbol;
@@ -183,13 +184,13 @@ const lldb_private::SymbolContext &SBSymbolContext::operator*() const {
}
lldb_private::SymbolContext &SBSymbolContext::operator*() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new SymbolContext);
return *m_opaque_up;
}
lldb_private::SymbolContext &SBSymbolContext::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new SymbolContext);
return *m_opaque_up;
}
@@ -205,7 +206,7 @@ bool SBSymbolContext::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_up) {
m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
} else
strm.PutCString("No value");
+2 -2
View File
@@ -93,7 +93,7 @@ bool SBSymbolContextList::IsValid() const {
SBSymbolContextList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContextList, operator bool);
return m_opaque_up != NULL;
return m_opaque_up != nullptr;
}
lldb_private::SymbolContextList *SBSymbolContextList::operator->() const {
@@ -111,7 +111,7 @@ bool SBSymbolContextList::GetDescription(lldb::SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_up)
m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
return true;
}
+27 -27
View File
@@ -126,7 +126,7 @@ bool SBTarget::EventIsTargetEvent(const SBEvent &event) {
LLDB_RECORD_STATIC_METHOD(bool, SBTarget, EventIsTargetEvent,
(const lldb::SBEvent &), event);
return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL;
return Target::TargetEventData::GetEventDataFromEvent(event.get()) != nullptr;
}
SBTarget SBTarget::GetTargetFromEvent(const SBEvent &event) {
@@ -171,7 +171,7 @@ bool SBTarget::IsValid() const {
SBTarget::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTarget, operator bool);
return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid();
return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid();
}
SBProcess SBTarget::GetProcess() {
@@ -288,9 +288,9 @@ SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
(const char **, const char **, const char *), argv, envp,
working_directory);
char *stdin_path = NULL;
char *stdout_path = NULL;
char *stderr_path = NULL;
char *stdin_path = nullptr;
char *stdout_path = nullptr;
char *stderr_path = nullptr;
uint32_t launch_flags = 0;
bool stop_at_entry = false;
SBError error;
@@ -307,7 +307,7 @@ SBError SBTarget::Install() {
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
sb_error.ref() = target_sp->Install(NULL);
sb_error.ref() = target_sp->Install(nullptr);
}
return LLDB_RECORD_RESULT(sb_error);
}
@@ -381,7 +381,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
if (listener.IsValid())
launch_info.SetListener(listener.GetSP());
error.SetError(target_sp->Launch(launch_info, NULL));
error.SetError(target_sp->Launch(launch_info, nullptr));
sb_process.SetSP(target_sp->GetProcessSP());
} else {
@@ -430,7 +430,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
if (arch_spec.IsValid())
launch_info.GetArchitecture() = arch_spec;
error.SetError(target_sp->Launch(launch_info, NULL));
error.SetError(target_sp->Launch(launch_info, nullptr));
sb_launch_info.set_ref(launch_info);
sb_process.SetSP(target_sp->GetProcessSP());
} else {
@@ -551,14 +551,14 @@ lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (listener.IsValid())
process_sp =
target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, NULL);
target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, nullptr);
else
process_sp = target_sp->CreateProcess(
target_sp->GetDebugger().GetListener(), plugin_name, NULL);
target_sp->GetDebugger().GetListener(), plugin_name, nullptr);
if (process_sp) {
sb_process.SetSP(process_sp);
error.SetError(process_sp->ConnectRemote(NULL, url));
error.SetError(process_sp->ConnectRemote(nullptr, url));
} else {
error.SetErrorString("unable to create lldb_private::Process");
}
@@ -788,12 +788,12 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
FileSpecList module_spec_list;
module_spec_list.Append(FileSpec(module_name));
sb_bp = target_sp->CreateBreakpoint(
&module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto,
&module_spec_list, nullptr, symbol_name, eFunctionNameTypeAuto,
eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
} else {
sb_bp = target_sp->CreateBreakpoint(
NULL, NULL, symbol_name, eFunctionNameTypeAuto, eLanguageTypeUnknown,
offset, skip_prologue, internal, hardware);
nullptr, nullptr, symbol_name, eFunctionNameTypeAuto,
eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
}
}
@@ -1425,7 +1425,7 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
// Target::CreateWatchpoint() is thread safe.
Status cw_error;
// This API doesn't take in a type, so we can't figure out what it is.
CompilerType *type = NULL;
CompilerType *type = nullptr;
watchpoint_sp =
target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error);
error.SetError(cw_error);
@@ -1559,7 +1559,7 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
(const char *, const char *, const char *), path, triple,
uuid_cstr);
return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, NULL));
return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, nullptr));
}
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
@@ -1683,7 +1683,7 @@ const char *SBTarget::GetTriple() {
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
return NULL;
return nullptr;
}
uint32_t SBTarget::GetDataByteSize() {
@@ -1969,7 +1969,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
if (exe_scope == NULL)
if (exe_scope == nullptr)
exe_scope = target_sp.get();
for (uint32_t i = 0; i < match_count; ++i) {
lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create(
@@ -2017,7 +2017,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
if (exe_scope == NULL)
if (exe_scope == nullptr)
exe_scope = target_sp.get();
for (uint32_t i = 0; i < match_count; ++i) {
lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create(
@@ -2053,7 +2053,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBTarget, ReadInstructions,
(lldb::SBAddress, uint32_t), base_addr, count);
return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, NULL));
return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, nullptr));
}
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
@@ -2080,7 +2080,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
data.GetByteSize(), error, &load_addr);
const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
sb_instructions.SetDisassembler(Disassembler::DisassembleBytes(
target_sp->GetArchitecture(), NULL, flavor_string, *addr_ptr,
target_sp->GetArchitecture(), nullptr, flavor_string, *addr_ptr,
data.GetBytes(), bytes_read, count, data_from_file));
}
}
@@ -2095,7 +2095,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::SBAddress base_addr,
(lldb::SBAddress, const void *, size_t), base_addr, buf,
size);
return GetInstructionsWithFlavor(base_addr, NULL, buf, size);
return GetInstructionsWithFlavor(base_addr, nullptr, buf, size);
}
lldb::SBInstructionList
@@ -2119,7 +2119,7 @@ SBTarget::GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const bool data_from_file = true;
sb_instructions.SetDisassembler(Disassembler::DisassembleBytes(
target_sp->GetArchitecture(), NULL, flavor_string, addr, buf, size,
target_sp->GetArchitecture(), nullptr, flavor_string, addr, buf, size,
UINT32_MAX, data_from_file));
}
@@ -2132,7 +2132,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::addr_t base_addr,
LLDB_RECORD_DUMMY(lldb::SBInstructionList, SBTarget, GetInstructions,
(lldb::addr_t, const void *, size_t), base_addr, buf, size);
return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), NULL, buf,
return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), nullptr, buf,
size);
}
@@ -2353,9 +2353,9 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
SBValue expr_result;
ValueObjectSP expr_value_sp;
TargetSP target_sp(GetSP());
StackFrame *frame = NULL;
StackFrame *frame = nullptr;
if (target_sp) {
if (expr == NULL || expr[0] == '\0') {
if (expr == nullptr || expr[0] == '\0') {
return LLDB_RECORD_RESULT(expr_result);
}
@@ -2409,7 +2409,7 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() {
lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo);
lldb::SBLaunchInfo launch_info(NULL);
lldb::SBLaunchInfo launch_info(nullptr);
TargetSP target_sp(GetSP());
if (target_sp)
launch_info.set_ref(m_opaque_sp->GetProcessLaunchInfo());
+11 -11
View File
@@ -122,7 +122,7 @@ SBThread::operator bool() const {
if (target && process) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock()))
return m_opaque_sp->GetThreadSP().get() != NULL;
return m_opaque_sp->GetThreadSP().get() != nullptr;
}
// Without a valid target & process, this thread can't be valid.
return false;
@@ -359,7 +359,7 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) {
stop_desc =
exe_ctx.GetProcessPtr()->GetUnixSignals()->GetSignalAsCString(
stop_info_sp->GetValue());
if (stop_desc == NULL || stop_desc[0] == '\0') {
if (stop_desc == nullptr || stop_desc[0] == '\0') {
static char signal_desc[] = "signal";
stop_desc = signal_desc;
stop_desc_len =
@@ -452,7 +452,7 @@ uint32_t SBThread::GetIndexID() const {
const char *SBThread::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetName);
const char *name = NULL;
const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -469,7 +469,7 @@ const char *SBThread::GetName() const {
const char *SBThread::GetQueueName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetQueueName);
const char *name = NULL;
const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -566,7 +566,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx,
// User level plans should be Master Plans so they can be interrupted, other
// plans executed, and then a "continue" will resume the plan.
if (new_plan != NULL) {
if (new_plan != nullptr) {
new_plan->SetIsMasterPlan(true);
new_plan->SetOkayToDiscard(false);
}
@@ -577,7 +577,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx,
if (process->GetTarget().GetDebugger().GetAsyncExecution())
sb_error.ref() = process->Resume();
else
sb_error.ref() = process->ResumeSynchronous(NULL);
sb_error.ref() = process->ResumeSynchronous(nullptr);
return sb_error;
}
@@ -627,7 +627,7 @@ void SBThread::StepInto(lldb::RunMode stop_other_threads) {
LLDB_RECORD_METHOD(void, SBThread, StepInto, (lldb::RunMode),
stop_other_threads);
StepInto(NULL, stop_other_threads);
StepInto(nullptr, stop_other_threads);
}
void SBThread::StepInto(const char *target_name,
@@ -716,7 +716,7 @@ void SBThread::StepOut(SBError &error) {
const LazyBool avoid_no_debug = eLazyBoolCalculate;
Status new_plan_status;
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
eVoteNoOpinion, 0, new_plan_status, avoid_no_debug));
if (new_plan_status.Success())
@@ -763,7 +763,7 @@ void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) {
Status new_plan_status;
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
eVoteNoOpinion, frame_sp->GetFrameIndex(), new_plan_status));
if (new_plan_status.Success())
@@ -878,7 +878,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame,
eSymbolContextCompUnit | eSymbolContextFunction |
eSymbolContextLineEntry | eSymbolContextSymbol);
if (frame_sc.comp_unit == NULL) {
if (frame_sc.comp_unit == nullptr) {
sb_error.SetErrorStringWithFormat(
"frame %u doesn't have debug information", frame_sp->GetFrameIndex());
return LLDB_RECORD_RESULT(sb_error);
@@ -1235,7 +1235,7 @@ bool SBThread::EventIsThreadEvent(const SBEvent &event) {
LLDB_RECORD_STATIC_METHOD(bool, SBThread, EventIsThreadEvent,
(const lldb::SBEvent &), event);
return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != NULL;
return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != nullptr;
}
SBFrame SBThread::GetStackFrameFromEvent(const SBEvent &event) {
+1 -1
View File
@@ -67,7 +67,7 @@ bool SBThreadCollection::IsValid() const {
SBThreadCollection::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadCollection, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
size_t SBThreadCollection::GetSize() {
+2 -2
View File
@@ -92,7 +92,7 @@ bool SBThreadPlan::IsValid() const {
SBThreadPlan::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadPlan, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
void SBThreadPlan::Clear() {
@@ -262,7 +262,7 @@ SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress &sb_start_address,
Status plan_status;
SBThreadPlan plan =
SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForStepInRange(
false, range, sc, NULL, eAllThreads, plan_status));
false, range, sc, nullptr, eAllThreads, plan_status));
if (plan_status.Fail())
error.SetErrorString(plan_status.AsCString());
+8 -8
View File
@@ -92,7 +92,7 @@ SBType &SBType::operator=(const SBType &rhs) {
SBType::~SBType() {}
TypeImpl &SBType::ref() {
if (m_opaque_sp.get() == NULL)
if (m_opaque_sp.get() == nullptr)
m_opaque_sp = std::make_shared<TypeImpl>();
return *m_opaque_sp;
}
@@ -112,7 +112,7 @@ bool SBType::IsValid() const {
SBType::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBType, operator bool);
if (m_opaque_sp.get() == NULL)
if (m_opaque_sp.get() == nullptr)
return false;
return m_opaque_sp->IsValid();
@@ -579,7 +579,7 @@ bool SBTypeList::IsValid() {
SBTypeList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeList, operator bool);
return (m_opaque_up != NULL);
return (m_opaque_up != nullptr);
}
SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) {
@@ -660,7 +660,7 @@ const char *SBTypeMember::GetName() {
if (m_opaque_up)
return m_opaque_up->GetName().GetCString();
return NULL;
return nullptr;
}
SBType SBTypeMember::GetType() {
@@ -743,7 +743,7 @@ void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
}
TypeMemberImpl &SBTypeMember::ref() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new TypeMemberImpl());
return *m_opaque_up;
}
@@ -789,7 +789,7 @@ const char *SBTypeMemberFunction::GetName() {
if (m_opaque_sp)
return m_opaque_sp->GetName().GetCString();
return NULL;
return nullptr;
}
const char *SBTypeMemberFunction::GetDemangledName() {
@@ -803,7 +803,7 @@ const char *SBTypeMemberFunction::GetDemangledName() {
return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString();
}
}
return NULL;
return nullptr;
}
const char *SBTypeMemberFunction::GetMangledName() {
@@ -812,7 +812,7 @@ const char *SBTypeMemberFunction::GetMangledName() {
if (m_opaque_sp)
return m_opaque_sp->GetMangledName().GetCString();
return NULL;
return nullptr;
}
SBType SBTypeMemberFunction::GetType() {
+2 -2
View File
@@ -49,7 +49,7 @@ bool SBTypeCategory::IsValid() const {
SBTypeCategory::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeCategory, operator bool);
return (m_opaque_sp.get() != NULL);
return (m_opaque_sp.get() != nullptr);
}
bool SBTypeCategory::GetEnabled() {
@@ -75,7 +75,7 @@ const char *SBTypeCategory::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeCategory, GetName);
if (!IsValid())
return NULL;
return nullptr;
return m_opaque_sp->GetName();
}
+3 -3
View File
@@ -64,7 +64,7 @@ const char *SBTypeEnumMember::GetName() {
if (m_opaque_sp.get())
return m_opaque_sp->GetName().GetCString();
return NULL;
return nullptr;
}
int64_t SBTypeEnumMember::GetValueAsSigned() {
@@ -98,7 +98,7 @@ void SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl) {
}
TypeEnumMemberImpl &SBTypeEnumMember::ref() {
if (m_opaque_sp.get() == NULL)
if (m_opaque_sp.get() == nullptr)
m_opaque_sp = std::make_shared<TypeEnumMemberImpl>();
return *m_opaque_sp.get();
}
@@ -130,7 +130,7 @@ bool SBTypeEnumMemberList::IsValid() {
SBTypeEnumMemberList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeEnumMemberList, operator bool);
return (m_opaque_up != NULL);
return (m_opaque_up != nullptr);
}
SBTypeEnumMemberList &SBTypeEnumMemberList::
+2 -2
View File
@@ -40,7 +40,7 @@ bool SBTypeFilter::IsValid() const {
SBTypeFilter::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFilter, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
uint32_t SBTypeFilter::GetOptions() {
@@ -98,7 +98,7 @@ const char *SBTypeFilter::GetExpressionPathAtIndex(uint32_t i) {
item++;
return item;
}
return NULL;
return nullptr;
}
bool SBTypeFilter::ReplaceExpressionPathAtIndex(uint32_t i, const char *item) {
+1 -1
View File
@@ -49,7 +49,7 @@ bool SBTypeFormat::IsValid() const {
SBTypeFormat::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFormat, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
lldb::Format SBTypeFormat::GetFormat() {
+4 -4
View File
@@ -27,7 +27,7 @@ SBTypeNameSpecifier::SBTypeNameSpecifier(const char *name, bool is_regex)
LLDB_RECORD_CONSTRUCTOR(SBTypeNameSpecifier, (const char *, bool), name,
is_regex);
if (name == NULL || (*name) == 0)
if (name == nullptr || (*name) == 0)
m_opaque_sp.reset();
}
@@ -54,14 +54,14 @@ bool SBTypeNameSpecifier::IsValid() const {
SBTypeNameSpecifier::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeNameSpecifier, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
const char *SBTypeNameSpecifier::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeNameSpecifier, GetName);
if (!IsValid())
return NULL;
return nullptr;
return m_opaque_sp->GetName();
}
@@ -129,7 +129,7 @@ bool SBTypeNameSpecifier::IsEqualTo(lldb::SBTypeNameSpecifier &rhs) {
if (IsRegex() != rhs.IsRegex())
return false;
if (GetName() == NULL || rhs.GetName() == NULL)
if (GetName() == nullptr || rhs.GetName() == nullptr)
return false;
return (strcmp(GetName(), rhs.GetName()) == 0);
+2 -2
View File
@@ -202,7 +202,7 @@ bool SBTypeSummary::IsValid() const {
SBTypeSummary::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSummary, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
bool SBTypeSummary::IsFunctionCode() {
@@ -244,7 +244,7 @@ const char *SBTypeSummary::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSummary, GetData);
if (!IsValid())
return NULL;
return nullptr;
if (ScriptSummaryFormat *script_summary_ptr =
llvm::dyn_cast<ScriptSummaryFormat>(m_opaque_sp.get())) {
const char *fname = script_summary_ptr->GetFunctionName();
+2 -2
View File
@@ -60,7 +60,7 @@ bool SBTypeSynthetic::IsValid() const {
SBTypeSynthetic::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSynthetic, operator bool);
return m_opaque_sp.get() != NULL;
return m_opaque_sp.get() != nullptr;
}
bool SBTypeSynthetic::IsClassCode() {
@@ -84,7 +84,7 @@ const char *SBTypeSynthetic::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSynthetic, GetData);
if (!IsValid())
return NULL;
return nullptr;
if (IsClassCode())
return m_opaque_sp->GetPythonCode();
else
+13 -13
View File
@@ -57,7 +57,7 @@ public:
ValueImpl(lldb::ValueObjectSP in_valobj_sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic,
const char *name = NULL)
const char *name = nullptr)
: m_valobj_sp(), m_use_dynamic(use_dynamic),
m_use_synthetic(use_synthetic), m_name(name) {
if (in_valobj_sp) {
@@ -84,7 +84,7 @@ public:
}
bool IsValid() {
if (m_valobj_sp.get() == NULL)
if (m_valobj_sp.get() == nullptr)
return false;
else {
// FIXME: This check is necessary but not sufficient. We for sure don't
@@ -251,8 +251,8 @@ SBValue::operator bool() const {
// If this function ever changes to anything that does more than just check
// if the opaque shared pointer is non NULL, then we need to update all "if
// (m_opaque_sp)" code in this file.
return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid() &&
m_opaque_sp->GetRootSP().get() != NULL;
return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid() &&
m_opaque_sp->GetRootSP().get() != nullptr;
}
void SBValue::Clear() {
@@ -290,7 +290,7 @@ user_id_t SBValue::GetID() {
const char *SBValue::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetName);
const char *name = NULL;
const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
@@ -302,7 +302,7 @@ const char *SBValue::GetName() {
const char *SBValue::GetTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeName);
const char *name = NULL;
const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -315,7 +315,7 @@ const char *SBValue::GetTypeName() {
const char *SBValue::GetDisplayTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetDisplayTypeName);
const char *name = NULL;
const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -356,7 +356,7 @@ bool SBValue::IsInScope() {
const char *SBValue::GetValue() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetValue);
const char *cstr = NULL;
const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -381,7 +381,7 @@ ValueType SBValue::GetValueType() {
const char *SBValue::GetObjectDescription() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetObjectDescription);
const char *cstr = NULL;
const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -394,7 +394,7 @@ const char *SBValue::GetObjectDescription() {
const char *SBValue::GetTypeValidatorResult() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeValidatorResult);
const char *cstr = NULL;
const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -442,7 +442,7 @@ bool SBValue::GetValueDidChange() {
const char *SBValue::GetSummary() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetSummary);
const char *cstr = NULL;
const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -472,7 +472,7 @@ const char *SBValue::GetSummary(lldb::SBStream &stream,
const char *SBValue::GetLocation() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetLocation);
const char *cstr = NULL;
const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -1042,7 +1042,7 @@ void *SBValue::GetOpaqueType() {
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
return value_sp->GetCompilerType().GetOpaqueQualType();
return NULL;
return nullptr;
}
lldb::SBTarget SBValue::GetTarget() {
+2 -2
View File
@@ -92,7 +92,7 @@ bool SBValueList::IsValid() const {
SBValueList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBValueList, operator bool);
return (m_opaque_up != NULL);
return (m_opaque_up != nullptr);
}
void SBValueList::Clear() {
@@ -172,7 +172,7 @@ uint32_t SBValueList::GetSize() const {
}
void SBValueList::CreateIfNeeded() {
if (m_opaque_up == NULL)
if (m_opaque_up == nullptr)
m_opaque_up.reset(new ValueListImpl());
}
+2 -2
View File
@@ -218,7 +218,7 @@ const char *SBWatchpoint::GetCondition() {
watchpoint_sp->GetTarget().GetAPIMutex());
return watchpoint_sp->GetConditionText();
}
return NULL;
return nullptr;
}
void SBWatchpoint::SetCondition(const char *condition) {
@@ -277,7 +277,7 @@ bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) {
(const lldb::SBEvent &), event);
return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) !=
NULL;
nullptr;
}
WatchpointEventType
@@ -124,7 +124,7 @@ Searcher::CallbackReturn
BreakpointResolverAddress::SearchCallback(SearchFilter &filter,
SymbolContext &context, Address *addr,
bool containing) {
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
if (filter.AddressPasses(m_addr)) {
if (m_breakpoint->GetNumLocations() == 0) {
@@ -204,7 +204,7 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
Address *addr, bool containing) {
SymbolContextList sc_list;
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
// There is a tricky bit here. You can have two compilation units that
// #include the same file, and in one of them the function at m_line_number
@@ -98,7 +98,7 @@ BreakpointResolverFileRegex::SearchCallback(SearchFilter &filter,
SymbolContext &context,
Address *addr, bool containing) {
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
if (!context.target_sp)
return eCallbackReturnContinue;
@@ -145,7 +145,7 @@ BreakpointResolverFileRegex::SearchCallback(SearchFilter &filter,
BreakpointResolver::SetSCMatchesByLine(filter, sc_list, skip_prologue,
m_regex.GetText());
}
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
return Searcher::eCallbackReturnContinue;
}
@@ -127,7 +127,7 @@ Searcher::CallbackReturn
BreakpointResolverScripted::SearchCallback(SearchFilter &filter,
SymbolContext &context, Address *addr,
bool containing) {
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
bool should_continue = true;
if (!m_implementation_sp)
return Searcher::eCallbackReturnStop;
@@ -144,7 +144,7 @@ BreakpointResolverScripted::SearchCallback(SearchFilter &filter,
lldb::SearchDepth
BreakpointResolverScripted::GetDepth() {
assert(m_breakpoint != NULL);
assert(m_breakpoint != nullptr);
lldb::SearchDepth depth = lldb::eSearchDepthModule;
if (m_implementation_sp) {
ScriptInterpreter *interp = GetScriptInterpreter();
@@ -68,7 +68,7 @@ protected:
bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
Stream *error_stream,
CommandReturnObject *result = NULL);
CommandReturnObject *result = nullptr);
void GetMultilineExpression();
+1 -1
View File
@@ -359,7 +359,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
// Let clients know that this thread is exiting
comm->BroadcastEvent(eBroadcastBitNoMorePendingInput);
comm->BroadcastEvent(eBroadcastBitReadThreadDidExit);
return NULL;
return nullptr;
}
void Communication::SetReadThreadBytesReceivedCallback(
+2 -2
View File
@@ -1616,7 +1616,7 @@ void Debugger::DefaultEventHandler() {
lldb::thread_result_t Debugger::EventHandlerThread(lldb::thread_arg_t arg) {
((Debugger *)arg)->DefaultEventHandler();
return NULL;
return nullptr;
}
bool Debugger::StartEventHandlerThread() {
@@ -1661,7 +1661,7 @@ lldb::thread_result_t Debugger::IOHandlerThread(lldb::thread_arg_t arg) {
Debugger *debugger = (Debugger *)arg;
debugger->ExecuteIOHandlers();
debugger->StopEventHandlerThread();
return NULL;
return nullptr;
}
bool Debugger::HasIOHandlerThread() { return m_io_handler_thread.IsJoinable(); }
+1 -1
View File
@@ -160,7 +160,7 @@ Mangled::~Mangled() {}
// if (mangled)
// { ...
Mangled::operator void *() const {
return (m_mangled) ? const_cast<Mangled *>(this) : NULL;
return (m_mangled) ? const_cast<Mangled *>(this) : nullptr;
}
// Logical NOT operator. This allows code to check any Mangled objects to see
+7 -7
View File
@@ -342,7 +342,7 @@ void Section::DumpName(Stream *s) const {
s->PutChar('.');
} else {
// The top most section prints the module basename
const char *name = NULL;
const char *name = nullptr;
ModuleSP module_sp(GetModule());
if (m_obj_file) {
@@ -509,7 +509,7 @@ SectionList::FindSectionByName(ConstString section_dstr) const {
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
Section *child_section = sect_iter->get();
if (child_section) {
if (child_section->GetName() == section_dstr) {
@@ -530,7 +530,7 @@ SectionSP SectionList::FindSectionByID(user_id_t sect_id) const {
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
if ((*sect_iter)->GetID() == sect_id) {
sect_sp = *sect_iter;
break;
@@ -567,7 +567,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
Section *sect = sect_iter->get();
if (sect->ContainsFileAddress(vm_addr)) {
// The file address is in this section. We need to make sure one of our
@@ -577,7 +577,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
sect_sp = sect->GetChildren().FindSectionContainingFileAddress(
vm_addr, depth - 1);
if (sect_sp.get() == NULL && !sect->IsFake())
if (sect_sp.get() == nullptr && !sect->IsFake())
sect_sp = *sect_iter;
}
}
@@ -585,7 +585,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
}
bool SectionList::ContainsSection(user_id_t sect_id) const {
return FindSectionByID(sect_id).get() != NULL;
return FindSectionByID(sect_id).get() != nullptr;
}
void SectionList::Dump(Stream *s, Target *target, bool show_header,
@@ -608,7 +608,7 @@ void SectionList::Dump(Stream *s, Target *target, bool show_header,
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
(*sect_iter)->Dump(s, target_has_loaded_sections ? target : NULL, depth);
(*sect_iter)->Dump(s, target_has_loaded_sections ? target : nullptr, depth);
}
if (show_header && !m_sections.empty())
+5 -5
View File
@@ -326,7 +326,7 @@ bool SourceManager::GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line) {
bool inlines_okay = true;
bool append = false;
size_t num_matches = executable_ptr->FindFunctions(
main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay,
main_name, nullptr, lldb::eFunctionNameTypeBase, inlines_okay,
symbols_okay, append, sc_list);
for (size_t idx = 0; idx < num_matches; idx++) {
SymbolContext sc;
@@ -399,7 +399,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
if (num_matches != 0) {
if (num_matches > 1) {
SymbolContext sc;
FileSpec *test_cu_spec = NULL;
FileSpec *test_cu_spec = nullptr;
for (unsigned i = 0; i < num_matches; i++) {
sc_list.GetContextAtIndex(i, sc);
@@ -461,12 +461,12 @@ uint32_t SourceManager::File::GetNumLines() {
const char *SourceManager::File::PeekLineData(uint32_t line) {
if (!LineIsValid(line))
return NULL;
return nullptr;
size_t line_offset = GetLineOffset(line);
if (line_offset < m_data_sp->GetByteSize())
return (const char *)m_data_sp->GetBytes() + line_offset;
return NULL;
return nullptr;
}
uint32_t SourceManager::File::GetLineLength(uint32_t line,
@@ -621,7 +621,7 @@ bool SourceManager::File::CalculateLineOffsets(uint32_t line) {
return true;
if (m_offsets.empty()) {
if (m_data_sp.get() == NULL)
if (m_data_sp.get() == nullptr)
return false;
const char *start = (char *)m_data_sp->GetBytes();
+15 -15
View File
@@ -39,17 +39,17 @@ using namespace lldb;
using namespace lldb_private;
Value::Value()
: m_value(), m_vector(), m_compiler_type(), m_context(NULL),
: m_value(), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeScalar), m_context_type(eContextTypeInvalid),
m_data_buffer() {}
Value::Value(const Scalar &scalar)
: m_value(scalar), m_vector(), m_compiler_type(), m_context(NULL),
: m_value(scalar), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeScalar), m_context_type(eContextTypeInvalid),
m_data_buffer() {}
Value::Value(const void *bytes, int len)
: m_value(), m_vector(), m_compiler_type(), m_context(NULL),
: m_value(), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeHostAddress), m_context_type(eContextTypeInvalid),
m_data_buffer() {
SetBytes(bytes, len);
@@ -131,13 +131,13 @@ AddressType Value::GetValueAddressType() const {
RegisterInfo *Value::GetRegisterInfo() const {
if (m_context_type == eContextTypeRegisterInfo)
return static_cast<RegisterInfo *>(m_context);
return NULL;
return nullptr;
}
Type *Value::GetType() {
if (m_context_type == eContextTypeLLDBType)
return static_cast<Type *>(m_context);
return NULL;
return nullptr;
}
size_t Value::AppendDataToHostBuffer(const Value &rhs) {
@@ -353,11 +353,11 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
break;
}
case eValueTypeLoadAddress:
if (exe_ctx == NULL) {
if (exe_ctx == nullptr) {
error.SetErrorString("can't read load address (no execution context)");
} else {
Process *process = exe_ctx->GetProcessPtr();
if (process == NULL || !process->IsAlive()) {
if (process == nullptr || !process->IsAlive()) {
Target *target = exe_ctx->GetTargetPtr();
if (target) {
// Allow expressions to run and evaluate things when the target has
@@ -390,16 +390,16 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
break;
case eValueTypeFileAddress:
if (exe_ctx == NULL) {
if (exe_ctx == nullptr) {
error.SetErrorString("can't read file address (no execution context)");
} else if (exe_ctx->GetTargetPtr() == NULL) {
} else if (exe_ctx->GetTargetPtr() == nullptr) {
error.SetErrorString("can't read file address (invalid target)");
} else {
address = m_value.ULongLong(LLDB_INVALID_ADDRESS);
if (address == LLDB_INVALID_ADDRESS) {
error.SetErrorString("invalid file address");
} else {
if (module == NULL) {
if (module == nullptr) {
// The only thing we can currently lock down to a module so that we
// can resolve a file address, is a variable.
Variable *variable = GetVariable();
@@ -527,7 +527,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
}
uint8_t *dst = const_cast<uint8_t *>(data.PeekData(data_offset, byte_size));
if (dst != NULL) {
if (dst != nullptr) {
if (address_type == eAddressTypeHost) {
// The address is an address in this process, so just copy it.
if (address == 0) {
@@ -597,7 +597,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
{
DataExtractor data;
lldb::addr_t addr = m_value.ULongLong(LLDB_INVALID_ADDRESS);
Status error(GetValueAsData(exe_ctx, data, 0, NULL));
Status error(GetValueAsData(exe_ctx, data, 0, nullptr));
if (error.Success()) {
Scalar scalar;
if (compiler_type.GetValueAsScalar(data, 0, data.GetByteSize(),
@@ -625,7 +625,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
Variable *Value::GetVariable() {
if (m_context_type == eContextTypeVariable)
return static_cast<Variable *>(m_context);
return NULL;
return nullptr;
}
void Value::Clear() {
@@ -633,7 +633,7 @@ void Value::Clear() {
m_vector.Clear();
m_compiler_type.Clear();
m_value_type = eValueTypeScalar;
m_context = NULL;
m_context = nullptr;
m_context_type = eContextTypeInvalid;
m_data_buffer.Clear();
}
@@ -702,7 +702,7 @@ Value *ValueList::GetValueAtIndex(size_t idx) {
if (idx < GetSize()) {
return &(m_values[idx]);
} else
return NULL;
return nullptr;
}
void ValueList::Clear() { m_values.clear(); }
+34 -33
View File
@@ -81,12 +81,13 @@ static user_id_t g_value_obj_uid = 0;
// ValueObject constructor
ValueObject::ValueObject(ValueObject &parent)
: UserID(++g_value_obj_uid), // Unique identifier for every value object
m_parent(&parent), m_root(NULL), m_update_point(parent.GetUpdatePoint()),
m_name(), m_data(), m_value(), m_error(), m_value_str(),
m_old_value_str(), m_location_str(), m_summary_str(), m_object_desc_str(),
m_validation_result(), m_manager(parent.GetManager()), m_children(),
m_synthetic_children(), m_dynamic_value(NULL), m_synthetic_value(NULL),
m_deref_valobj(NULL), m_format(eFormatDefault),
m_parent(&parent), m_root(nullptr),
m_update_point(parent.GetUpdatePoint()), m_name(), m_data(), m_value(),
m_error(), m_value_str(), m_old_value_str(), m_location_str(),
m_summary_str(), m_object_desc_str(), m_validation_result(),
m_manager(parent.GetManager()), m_children(), m_synthetic_children(),
m_dynamic_value(nullptr), m_synthetic_value(nullptr),
m_deref_valobj(nullptr), m_format(eFormatDefault),
m_last_format(eFormatDefault), m_last_format_mgr_revision(0),
m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(),
m_type_validator_sp(), m_user_id_of_forced_summary(),
@@ -108,15 +109,15 @@ ValueObject::ValueObject(ValueObject &parent)
ValueObject::ValueObject(ExecutionContextScope *exe_scope,
AddressType child_ptr_or_ref_addr_type)
: UserID(++g_value_obj_uid), // Unique identifier for every value object
m_parent(NULL), m_root(NULL), m_update_point(exe_scope), m_name(),
m_parent(nullptr), m_root(nullptr), m_update_point(exe_scope), m_name(),
m_data(), m_value(), m_error(), m_value_str(), m_old_value_str(),
m_location_str(), m_summary_str(), m_object_desc_str(),
m_validation_result(), m_manager(), m_children(), m_synthetic_children(),
m_dynamic_value(NULL), m_synthetic_value(NULL), m_deref_valobj(NULL),
m_format(eFormatDefault), m_last_format(eFormatDefault),
m_last_format_mgr_revision(0), m_type_summary_sp(), m_type_format_sp(),
m_synthetic_children_sp(), m_type_validator_sp(),
m_user_id_of_forced_summary(),
m_dynamic_value(nullptr), m_synthetic_value(nullptr),
m_deref_valobj(nullptr), m_format(eFormatDefault),
m_last_format(eFormatDefault), m_last_format_mgr_revision(0),
m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(),
m_type_validator_sp(), m_user_id_of_forced_summary(),
m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type),
m_value_checksum(),
m_preferred_display_language(lldb::eLanguageTypeUnknown),
@@ -465,7 +466,7 @@ ValueObjectSP ValueObject::GetChildAtIndex(size_t idx, bool can_create) {
}
ValueObject *child = m_children.GetChildAtIndex(idx);
if (child != NULL)
if (child != nullptr)
return child->GetSP();
}
return child_sp;
@@ -617,7 +618,7 @@ void ValueObject::SetName(ConstString name) { m_name = name; }
ValueObject *ValueObject::CreateChildAtIndex(size_t idx,
bool synthetic_array_member,
int32_t synthetic_index) {
ValueObject *valobj = NULL;
ValueObject *valobj = nullptr;
bool omit_empty_base_classes = true;
bool ignore_array_bounds = synthetic_array_member;
@@ -710,7 +711,7 @@ const char *ValueObject::GetSummaryAsCString(lldb::LanguageType lang) {
summary_options);
}
if (m_summary_str.empty())
return NULL;
return nullptr;
return m_summary_str.c_str();
}
@@ -763,12 +764,12 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
if (is_pointer_type) {
Status error;
ValueObjectSP pointee_sp = Dereference(error);
if (error.Fail() || pointee_sp.get() == NULL)
if (error.Fail() || pointee_sp.get() == nullptr)
return 0;
return pointee_sp->GetData(data, error);
} else {
ValueObjectSP child_sp = GetChildAtIndex(0, true);
if (child_sp.get() == NULL)
if (child_sp.get() == nullptr)
return 0;
Status error;
return child_sp->GetData(data, error);
@@ -777,7 +778,7 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
} else /* (items > 1) */
{
Status error;
lldb_private::DataBufferHeap *heap_buf_ptr = NULL;
lldb_private::DataBufferHeap *heap_buf_ptr = nullptr;
lldb::DataBufferSP data_sp(heap_buf_ptr =
new lldb_private::DataBufferHeap());
@@ -964,7 +965,7 @@ ValueObject::ReadPointedString(lldb::DataBufferSP &buffer_sp, Status &error,
if (is_array) {
// We have an array
uint64_t array_size = 0;
if (compiler_type.IsArrayType(NULL, &array_size, NULL)) {
if (compiler_type.IsArrayType(nullptr, &array_size, nullptr)) {
cstr_len = array_size;
if (cstr_len > max_length) {
capped_data = true;
@@ -1170,7 +1171,7 @@ const char *ValueObject::GetValueAsCString() {
}
}
if (m_value_str.empty())
return NULL;
return nullptr;
return m_value_str.c_str();
}
@@ -1281,7 +1282,7 @@ bool ValueObject::DumpPrintableRepresentation(
buffer_sp, lldb::eByteOrderInvalid,
8)); // none of this matters for a string - pass some defaults
options.SetStream(&s);
options.SetPrefixToken(0);
options.SetPrefixToken(nullptr);
options.SetQuote('"');
options.SetSourceSize(buffer_sp->GetByteSize());
options.SetIsTruncated(read_string.second);
@@ -1670,7 +1671,7 @@ ValueObject::GetTypeInfo(CompilerType *pointee_or_element_compiler_type) {
bool ValueObject::IsPointerType() { return GetCompilerType().IsPointerType(); }
bool ValueObject::IsArrayType() {
return GetCompilerType().IsArrayType(NULL, NULL, NULL);
return GetCompilerType().IsArrayType(nullptr, nullptr, nullptr);
}
bool ValueObject::IsScalarType() { return GetCompilerType().IsScalarType(); }
@@ -1689,7 +1690,7 @@ bool ValueObject::IsPossibleDynamicType() {
if (process)
return process->IsPossibleDynamicValue(*this);
else
return GetCompilerType().IsPossibleDynamicType(NULL, true, true);
return GetCompilerType().IsPossibleDynamicType(nullptr, true, true);
}
bool ValueObject::IsRuntimeSupportValue() {
@@ -1900,7 +1901,7 @@ ValueObject::GetSyntheticExpressionPathChild(const char *expression,
// We haven't made a synthetic array member for expression yet, so lets
// make one and cache it for any future reference.
synthetic_child_sp = GetValueForExpressionPath(
expression, NULL, NULL,
expression, nullptr, nullptr,
GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal(
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::
None));
@@ -1923,7 +1924,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) {
TargetSP target_sp(GetTargetSP());
if (target_sp && !target_sp->GetEnableSyntheticValue()) {
m_synthetic_value = NULL;
m_synthetic_value = nullptr;
return;
}
@@ -1932,7 +1933,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) {
if (!UpdateFormatsIfNeeded() && m_synthetic_value)
return;
if (m_synthetic_children_sp.get() == NULL)
if (m_synthetic_children_sp.get() == nullptr)
return;
if (current_synth_sp == m_synthetic_children_sp && m_synthetic_value)
@@ -1959,7 +1960,7 @@ ValueObjectSP ValueObject::GetDynamicValue(DynamicValueType use_dynamic) {
if (use_dynamic == eNoDynamicValues)
return ValueObjectSP();
if (!IsDynamic() && m_dynamic_value == NULL) {
if (!IsDynamic() && m_dynamic_value == nullptr) {
CalculateDynamicValue(use_dynamic);
}
if (m_dynamic_value)
@@ -1987,7 +1988,7 @@ ValueObjectSP ValueObject::GetSyntheticValue(bool use_synthetic) {
bool ValueObject::HasSyntheticValue() {
UpdateFormatsIfNeeded();
if (m_synthetic_children_sp.get() == NULL)
if (m_synthetic_children_sp.get() == nullptr)
return false;
CalculateSyntheticValue(true);
@@ -2020,7 +2021,7 @@ ValueObject *ValueObject::GetNonBaseClassParent() {
else
return GetParent();
}
return NULL;
return nullptr;
}
bool ValueObject::IsBaseClass(uint32_t &depth) {
@@ -3005,12 +3006,12 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState(
ExecutionContext exe_ctx(
m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped));
if (exe_ctx.GetTargetPtr() == NULL)
if (exe_ctx.GetTargetPtr() == nullptr)
return false;
// If we don't have a process nothing can change.
Process *process = exe_ctx.GetProcessPtr();
if (process == NULL)
if (process == nullptr)
return false;
// If our stop id is the current stop ID, nothing has changed:
@@ -3091,7 +3092,7 @@ void ValueObject::ClearUserVisibleData(uint32_t clear_mask) {
if ((clear_mask & eClearUserVisibleDataItemsSyntheticChildren) ==
eClearUserVisibleDataItemsSyntheticChildren) {
if (m_synthetic_value)
m_synthetic_value = NULL;
m_synthetic_value = nullptr;
}
if ((clear_mask & eClearUserVisibleDataItemsValidator) ==
@@ -3104,7 +3105,7 @@ SymbolContextScope *ValueObject::GetSymbolContextScope() {
if (!m_parent->IsPointerOrReferenceType())
return m_parent->GetSymbolContextScope();
}
return NULL;
return nullptr;
}
lldb::ValueObjectSP
+10 -10
View File
@@ -39,7 +39,7 @@ ValueObjectConstResultImpl::ValueObjectConstResultImpl(
m_address_of_backend() {}
lldb::ValueObjectSP ValueObjectConstResultImpl::Dereference(Status &error) {
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
return m_impl_backend->ValueObject::Dereference(error);
@@ -47,12 +47,12 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::Dereference(Status &error) {
ValueObject *ValueObjectConstResultImpl::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
if (m_impl_backend == NULL)
return NULL;
if (m_impl_backend == nullptr)
return nullptr;
m_impl_backend->UpdateValueIfNeeded(false);
ValueObjectConstResultChild *valobj = NULL;
ValueObjectConstResultChild *valobj = nullptr;
bool omit_empty_base_classes = true;
bool ignore_array_bounds = synthetic_array_member;
@@ -106,7 +106,7 @@ ValueObject *ValueObjectConstResultImpl::CreateChildAtIndex(
lldb::ValueObjectSP ValueObjectConstResultImpl::GetSyntheticChildAtOffset(
uint32_t offset, const CompilerType &type, bool can_create,
ConstString name_const_str) {
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
return m_impl_backend->ValueObject::GetSyntheticChildAtOffset(
@@ -114,10 +114,10 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::GetSyntheticChildAtOffset(
}
lldb::ValueObjectSP ValueObjectConstResultImpl::AddressOf(Status &error) {
if (m_address_of_backend.get() != NULL)
if (m_address_of_backend.get() != nullptr)
return m_address_of_backend;
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
if (m_live_address != LLDB_INVALID_ADDRESS) {
CompilerType compiler_type(m_impl_backend->GetCompilerType());
@@ -143,7 +143,7 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::AddressOf(Status &error) {
lldb::ValueObjectSP
ValueObjectConstResultImpl::Cast(const CompilerType &compiler_type) {
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
ValueObjectConstResultCast *result_cast =
@@ -156,7 +156,7 @@ lldb::addr_t
ValueObjectConstResultImpl::GetAddressOf(bool scalar_is_load_address,
AddressType *address_type) {
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return 0;
if (m_live_address == LLDB_INVALID_ADDRESS) {
@@ -173,7 +173,7 @@ ValueObjectConstResultImpl::GetAddressOf(bool scalar_is_load_address,
size_t ValueObjectConstResultImpl::GetPointeeData(DataExtractor &data,
uint32_t item_idx,
uint32_t item_count) {
if (m_impl_backend == NULL)
if (m_impl_backend == nullptr)
return 0;
return m_impl_backend->ValueObject::GetPointeeData(data, item_idx,
item_count);
+1 -1
View File
@@ -49,7 +49,7 @@ ValueObjectMemory::ValueObjectMemory(ExecutionContextScope *exe_scope,
: ValueObject(exe_scope), m_address(address), m_type_sp(type_sp),
m_compiler_type() {
// Do not attempt to construct one of these objects with no variable!
assert(m_type_sp.get() != NULL);
assert(m_type_sp.get() != nullptr);
SetName(ConstString(name));
m_value.SetContext(Value::eContextTypeLLDBType, m_type_sp.get());
TargetSP target_sp(GetTargetSP());
+10 -10
View File
@@ -76,7 +76,7 @@ bool ValueObjectRegisterContext::UpdateValue() {
else
m_reg_ctx_sp.reset();
if (m_reg_ctx_sp.get() == NULL) {
if (m_reg_ctx_sp.get() == nullptr) {
SetValueIsValid(false);
m_error.SetErrorToGenericError();
} else
@@ -87,7 +87,7 @@ bool ValueObjectRegisterContext::UpdateValue() {
ValueObject *ValueObjectRegisterContext::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
ValueObject *new_valobj = NULL;
ValueObject *new_valobj = nullptr;
const size_t num_children = GetNumChildren();
if (idx < num_children) {
@@ -112,7 +112,7 @@ ValueObjectRegisterSet::Create(ExecutionContextScope *exe_scope,
ValueObjectRegisterSet::ValueObjectRegisterSet(ExecutionContextScope *exe_scope,
lldb::RegisterContextSP &reg_ctx,
uint32_t reg_set_idx)
: ValueObject(exe_scope), m_reg_ctx_sp(reg_ctx), m_reg_set(NULL),
: ValueObject(exe_scope), m_reg_ctx_sp(reg_ctx), m_reg_set(nullptr),
m_reg_set_idx(reg_set_idx) {
assert(reg_ctx);
m_reg_set = reg_ctx->GetRegisterSet(m_reg_set_idx);
@@ -149,13 +149,13 @@ bool ValueObjectRegisterSet::UpdateValue() {
SetValueDidChange(false);
ExecutionContext exe_ctx(GetExecutionContextRef());
StackFrame *frame = exe_ctx.GetFramePtr();
if (frame == NULL)
if (frame == nullptr)
m_reg_ctx_sp.reset();
else {
m_reg_ctx_sp = frame->GetRegisterContext();
if (m_reg_ctx_sp) {
const RegisterSet *reg_set = m_reg_ctx_sp->GetRegisterSet(m_reg_set_idx);
if (reg_set == NULL)
if (reg_set == nullptr)
m_reg_ctx_sp.reset();
else if (m_reg_set != reg_set) {
SetValueDidChange(true);
@@ -175,7 +175,7 @@ bool ValueObjectRegisterSet::UpdateValue() {
ValueObject *ValueObjectRegisterSet::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
ValueObject *valobj = NULL;
ValueObject *valobj = nullptr;
if (m_reg_ctx_sp && m_reg_set) {
const size_t num_children = GetNumChildren();
if (idx < num_children)
@@ -188,11 +188,11 @@ ValueObject *ValueObjectRegisterSet::CreateChildAtIndex(
lldb::ValueObjectSP
ValueObjectRegisterSet::GetChildMemberWithName(ConstString name,
bool can_create) {
ValueObject *valobj = NULL;
ValueObject *valobj = nullptr;
if (m_reg_ctx_sp && m_reg_set) {
const RegisterInfo *reg_info =
m_reg_ctx_sp->GetRegisterInfoByName(name.AsCString());
if (reg_info != NULL)
if (reg_info != nullptr)
valobj = new ValueObjectRegister(*this, m_reg_ctx_sp,
reg_info->kinds[eRegisterKindLLDB]);
}
@@ -207,7 +207,7 @@ ValueObjectRegisterSet::GetIndexOfChildWithName(ConstString name) {
if (m_reg_ctx_sp && m_reg_set) {
const RegisterInfo *reg_info =
m_reg_ctx_sp->GetRegisterInfoByName(name.AsCString());
if (reg_info != NULL)
if (reg_info != nullptr)
return reg_info->kinds[eRegisterKindLLDB];
}
return UINT32_MAX;
@@ -289,7 +289,7 @@ bool ValueObjectRegister::UpdateValue() {
m_error.Clear();
ExecutionContext exe_ctx(GetExecutionContextRef());
StackFrame *frame = exe_ctx.GetFramePtr();
if (frame == NULL) {
if (frame == nullptr) {
m_reg_ctx_sp.reset();
m_reg_value.Clear();
}
+4 -4
View File
@@ -57,7 +57,7 @@ ValueObjectVariable::ValueObjectVariable(ExecutionContextScope *exe_scope,
const lldb::VariableSP &var_sp)
: ValueObject(exe_scope), m_variable_sp(var_sp) {
// Do not attempt to construct one of these objects with no variable!
assert(m_variable_sp.get() != NULL);
assert(m_variable_sp.get() != nullptr);
m_name = var_sp->GetName();
}
@@ -135,7 +135,7 @@ bool ValueObjectVariable::UpdateValue() {
else
m_error.SetErrorString("empty constant data");
// constant bytes can't be edited - sorry
m_resolved_value.SetContext(Value::eContextTypeInvalid, NULL);
m_resolved_value.SetContext(Value::eContextTypeInvalid, nullptr);
} else {
lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS;
ExecutionContext exe_ctx(GetExecutionContextRef());
@@ -261,7 +261,7 @@ bool ValueObjectVariable::UpdateValue() {
SetValueIsValid(m_error.Success());
} else {
// could not find location, won't allow editing
m_resolved_value.SetContext(Value::eContextTypeInvalid, NULL);
m_resolved_value.SetContext(Value::eContextTypeInvalid, nullptr);
}
}
return m_error.Success();
@@ -298,7 +298,7 @@ lldb::ModuleSP ValueObjectVariable::GetModule() {
SymbolContextScope *ValueObjectVariable::GetSymbolContextScope() {
if (m_variable_sp)
return m_variable_sp->GetSymbolContextScope();
return NULL;
return nullptr;
}
bool ValueObjectVariable::GetDeclaration(Declaration &decl) {
@@ -89,7 +89,7 @@ bool DataVisualization::Categories::GetCategory(ConstString category,
lldb::TypeCategoryImplSP &entry,
bool allow_create) {
entry = GetFormatManager().GetCategory(category, allow_create);
return (entry.get() != NULL);
return (entry.get() != nullptr);
}
bool DataVisualization::Categories::GetCategory(
+6 -6
View File
@@ -146,7 +146,7 @@ char FormatManager::GetFormatAsFormatChar(lldb::Format format) {
const char *FormatManager::GetFormatAsCString(Format format) {
if (format >= eFormatDefault && format < kNumFormats)
return g_format_infos[format].format_name;
return NULL;
return nullptr;
}
void FormatManager::EnableAllCategories() {
@@ -297,7 +297,7 @@ FormatManager::GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFormatImplSP format_current_sp =
category_sp->GetFormatForType(type_sp);
if (format_current_sp &&
(format_chosen_sp.get() == NULL ||
(format_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
format_chosen_sp = format_current_sp;
@@ -321,7 +321,7 @@ FormatManager::GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeSummaryImplSP summary_current_sp =
category_sp->GetSummaryForType(type_sp);
if (summary_current_sp &&
(summary_chosen_sp.get() == NULL ||
(summary_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
summary_chosen_sp = summary_current_sp;
@@ -345,7 +345,7 @@ FormatManager::GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFilterImplSP filter_current_sp(
(TypeFilterImpl *)category_sp->GetFilterForType(type_sp).get());
if (filter_current_sp &&
(filter_chosen_sp.get() == NULL ||
(filter_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
filter_chosen_sp = filter_current_sp;
@@ -370,7 +370,7 @@ FormatManager::GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp) {
(ScriptedSyntheticChildren *)category_sp->GetSyntheticForType(type_sp)
.get());
if (synth_current_sp &&
(synth_chosen_sp.get() == NULL ||
(synth_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
synth_chosen_sp = synth_current_sp;
@@ -394,7 +394,7 @@ FormatManager::GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeValidatorImplSP validator_current_sp(
category_sp->GetValidatorForType(type_sp).get());
if (validator_current_sp &&
(validator_chosen_sp.get() == NULL ||
(validator_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
validator_chosen_sp = validator_current_sp;
@@ -123,7 +123,7 @@ size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) {
if (*item_name != '[')
return UINT32_MAX;
item_name++;
char *endptr = NULL;
char *endptr = nullptr;
unsigned long int idx = ::strtoul(item_name, &endptr, 0);
if (idx == 0 && endptr == item_name)
return UINT32_MAX;
+4 -4
View File
@@ -271,7 +271,7 @@ static bool DumpUTFBufferToStream(
llvm::ConversionFlags),
const StringPrinter::ReadBufferAndDumpToStreamOptions &dump_options) {
Stream &stream(*dump_options.GetStream());
if (dump_options.GetPrefixToken() != 0)
if (dump_options.GetPrefixToken() != nullptr)
stream.Printf("%s", dump_options.GetPrefixToken());
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
@@ -373,7 +373,7 @@ static bool DumpUTFBufferToStream(
}
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
if (dump_options.GetSuffixToken() != 0)
if (dump_options.GetSuffixToken() != nullptr)
stream.Printf("%s", dump_options.GetSuffixToken());
if (dump_options.GetIsTruncated())
stream.Printf("...");
@@ -449,7 +449,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *prefix_token = options.GetPrefixToken();
char quote = options.GetQuote();
if (prefix_token != 0)
if (prefix_token != nullptr)
options.GetStream()->Printf("%s%c", prefix_token, quote);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
@@ -497,7 +497,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *suffix_token = options.GetSuffixToken();
if (suffix_token != 0)
if (suffix_token != nullptr)
options.GetStream()->Printf("%c%s", quote, suffix_token);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
+1 -1
View File
@@ -69,7 +69,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
// default value logic
if (GetFormat() == eFormatCString) {
lldb_private::Flags type_flags(compiler_type.GetTypeInfo(
NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
nullptr)); // disambiguate w.r.t. TypeFormatImpl::Flags
if (type_flags.Test(eTypeIsPointer) &&
!type_flags.Test(eTypeIsObjC)) {
// if we are dumping a pointer as a c-string, get the pointee data
+9 -9
View File
@@ -128,7 +128,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData(
ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
ValueObject &backend)
: SyntheticChildrenFrontEnd(backend), m_python_class(pclass),
m_wrapper_sp(), m_interpreter(NULL) {
m_wrapper_sp(), m_interpreter(nullptr) {
if (backend == LLDB_INVALID_UID)
return;
@@ -139,7 +139,7 @@ ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
m_interpreter = target_sp->GetDebugger().GetScriptInterpreter();
if (m_interpreter != NULL)
if (m_interpreter != nullptr)
m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(
m_python_class.c_str(), backend.GetSP());
}
@@ -159,26 +159,26 @@ bool ScriptedSyntheticChildren::FrontEnd::IsValid() {
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren() {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, UINT32_MAX);
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren(uint32_t max) {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, max);
}
bool ScriptedSyntheticChildren::FrontEnd::Update() {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);
}
bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);
@@ -186,21 +186,21 @@ bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
size_t ScriptedSyntheticChildren::FrontEnd::GetIndexOfChildWithName(
ConstString name) {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return UINT32_MAX;
return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp,
name.GetCString());
}
lldb::ValueObjectSP ScriptedSyntheticChildren::FrontEnd::GetSyntheticValue() {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return nullptr;
return m_interpreter->GetSyntheticValue(m_wrapper_sp);
}
ConstString ScriptedSyntheticChildren::FrontEnd::GetSyntheticTypeName() {
if (!m_wrapper_sp || m_interpreter == NULL)
if (!m_wrapper_sp || m_interpreter == nullptr)
return ConstString();
return m_interpreter->GetSyntheticTypeName(m_wrapper_sp);
@@ -331,7 +331,7 @@ TypeSummaryImpl *ValueObjectPrinter::GetSummaryFormatter(bool null_if_omitted) {
: m_valobj->GetSummaryFormat().get();
if (m_options.m_omit_summary_depth > 0)
entry = NULL;
entry = nullptr;
m_summary_formatter.first = entry;
m_summary_formatter.second = true;
}
@@ -415,8 +415,9 @@ bool ValueObjectPrinter::PrintValueAndSummaryIfNeeded(bool &value_printed,
// explicitly)
TypeSummaryImpl *entry = GetSummaryFormatter();
if (!IsNil() && !IsUninitialized() && !m_value.empty() &&
(entry == NULL || (entry->DoesPrintValue(m_valobj) ||
m_options.m_format != eFormatDefault) ||
(entry == nullptr ||
(entry->DoesPrintValue(m_valobj) ||
m_options.m_format != eFormatDefault) ||
m_summary.empty()) &&
!m_options.m_hide_value) {
if (m_options.m_hide_pointer_value &&
+6 -6
View File
@@ -649,7 +649,7 @@ static bool ReadRegisterValueAsScalar(RegisterContext *reg_ctx,
lldb::RegisterKind reg_kind,
uint32_t reg_num, Status *error_ptr,
Value &value) {
if (reg_ctx == NULL) {
if (reg_ctx == nullptr) {
if (error_ptr)
error_ptr->SetErrorStringWithFormat("No register context in frame.\n");
} else {
@@ -1249,7 +1249,7 @@ bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
if (IsLocationList()) {
lldb::offset_t offset = 0;
addr_t pc;
StackFrame *frame = NULL;
StackFrame *frame = nullptr;
if (reg_ctx)
pc = reg_ctx->GetPC();
else {
@@ -1323,14 +1323,14 @@ bool DWARFExpression::Evaluate(
}
std::vector<Value> stack;
Process *process = NULL;
StackFrame *frame = NULL;
Process *process = nullptr;
StackFrame *frame = nullptr;
if (exe_ctx) {
process = exe_ctx->GetProcessPtr();
frame = exe_ctx->GetFramePtr();
}
if (reg_ctx == NULL && frame)
if (reg_ctx == nullptr && frame)
reg_ctx = frame->GetRegisterContext().get();
if (initial_value_ptr)
@@ -3166,7 +3166,7 @@ void DWARFExpression::PrintDWARFLocationList(
s.Indent();
if (cu)
s.AddressRange(start_addr + base_addr, end_addr + base_addr,
cu->GetAddressByteSize(), NULL, ": ");
cu->GetAddressByteSize(), nullptr, ": ");
uint32_t loc_length = debug_loc_data.GetU16(&offset);
DataExtractor locationData(debug_loc_data, offset, loc_length);
@@ -25,7 +25,7 @@ uint8_t *ExpressionVariable::GetValueBytes() {
return const_cast<uint8_t *>(
m_frozen_sp->GetDataExtractor().GetDataStart());
}
return NULL;
return nullptr;
}
PersistentExpressionState::~PersistentExpressionState() {}
+10 -11
View File
@@ -35,10 +35,9 @@ FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope,
const Address &functionAddress,
const ValueList &arg_value_list,
const char *name)
: Expression(exe_scope, eKindFunctionCaller),
m_execution_unit_sp(), m_parser(),
m_jit_module_wp(), m_name(name ? name : "<unknown>"),
m_function_ptr(NULL), m_function_addr(functionAddress),
: Expression(exe_scope, eKindFunctionCaller), m_execution_unit_sp(),
m_parser(), m_jit_module_wp(), m_name(name ? name : "<unknown>"),
m_function_ptr(nullptr), m_function_addr(functionAddress),
m_function_return_type(return_type),
m_wrapper_function_name("__lldb_caller_function"),
m_wrapper_struct_name("__lldb_caller_struct"), m_wrapper_args_addrs(),
@@ -138,7 +137,7 @@ bool FunctionCaller::WriteFunctionArguments(
Process *process = exe_ctx.GetProcessPtr();
if (process == NULL)
if (process == nullptr)
return return_value;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
@@ -239,11 +238,11 @@ lldb::ThreadPlanSP FunctionCaller::GetThreadPlanToCallFunction(
// FIXME: Use the errors Stream for better error reporting.
Thread *thread = exe_ctx.GetThreadPtr();
if (thread == NULL) {
if (thread == nullptr) {
diagnostic_manager.PutString(
eDiagnosticSeverityError,
"Can't call a function without a valid thread.");
return NULL;
return nullptr;
}
// Okay, now run the function:
@@ -279,7 +278,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx,
Process *process = exe_ctx.GetProcessPtr();
if (process == NULL)
if (process == nullptr)
return false;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
@@ -326,7 +325,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
lldb::addr_t args_addr;
if (args_addr_ptr != NULL)
if (args_addr_ptr != nullptr)
args_addr = *args_addr_ptr;
else
args_addr = LLDB_INVALID_ADDRESS;
@@ -376,7 +375,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
if (exe_ctx.GetProcessPtr())
exe_ctx.GetProcessPtr()->SetRunningUserExpression(false);
if (args_addr_ptr != NULL)
if (args_addr_ptr != nullptr)
*args_addr_ptr = args_addr;
if (return_value != lldb::eExpressionCompleted)
@@ -384,7 +383,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
FetchFunctionResults(exe_ctx, args_addr, results);
if (args_addr_ptr == NULL)
if (args_addr_ptr == nullptr)
DeallocateFunctionResults(exe_ctx, args_addr);
return lldb::eExpressionCompleted;
+4 -4
View File
@@ -165,8 +165,8 @@ Status IRExecutionUnit::DisassembleFunction(Stream &stream,
ArchSpec arch(target->GetArchitecture());
const char *plugin_name = NULL;
const char *flavor_string = NULL;
const char *plugin_name = nullptr;
const char *flavor_string = nullptr;
lldb::DisassemblerSP disassembler_sp =
Disassembler::FindPlugin(arch, flavor_string, plugin_name);
@@ -251,7 +251,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
std::string s;
llvm::raw_string_ostream oss(s);
m_module->print(oss, NULL);
m_module->print(oss, nullptr);
oss.flush();
@@ -839,7 +839,7 @@ lldb::addr_t IRExecutionUnit::FindInSymbols(
};
if (sc.module_sp) {
sc.module_sp->FindFunctions(spec.name, NULL, spec.mask,
sc.module_sp->FindFunctions(spec.name, nullptr, spec.mask,
true, // include_symbols
false, // include_inlines
true, // append
+1 -1
View File
@@ -654,7 +654,7 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
std::string s;
raw_string_ostream oss(s);
module.print(oss, NULL);
module.print(oss, nullptr);
oss.flush();
+1 -1
View File
@@ -263,7 +263,7 @@ ExecutionContextScope *IRMemoryMap::GetBestExecutionContextScope() const {
if (target_sp)
return target_sp.get();
return NULL;
return nullptr;
}
IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc,
@@ -50,7 +50,7 @@ LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope,
m_allow_objc(false), m_transformed_text(), m_execution_unit_sp(),
m_materializer_up(), m_jit_module_wp(), m_enforce_valid_object(true),
m_in_cplusplus_method(false), m_in_objectivec_method(false),
m_in_static_method(false), m_needs_object_ptr(false), m_target(NULL),
m_in_static_method(false), m_needs_object_ptr(false), m_target(nullptr),
m_can_interpret(false), m_materialized_address(LLDB_INVALID_ADDRESS) {}
LLVMUserExpression::~LLVMUserExpression() {
@@ -181,7 +181,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
if (execution_result == lldb::eExpressionInterrupted ||
execution_result == lldb::eExpressionHitBreakpoint) {
const char *error_desc = NULL;
const char *error_desc = nullptr;
if (call_plan_sp) {
lldb::StopInfoSP real_stop_info_sp = call_plan_sp->GetRealStopInfo();
+3 -3
View File
@@ -174,7 +174,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
Process *process = exe_ctx.GetProcessPtr();
if (process == NULL || process->GetState() != lldb::eStateStopped) {
if (process == nullptr || process->GetState() != lldb::eStateStopped) {
if (execution_policy == eExecutionPolicyAlways) {
if (log)
log->Printf("== [UserExpression::Evaluate] Expression may not run, but "
@@ -186,7 +186,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
}
}
if (process == NULL || !process->CanJIT())
if (process == nullptr || !process->CanJIT())
execution_policy = eExecutionPolicyNever;
// We need to set the expression execution thread here, turns out parse can
@@ -375,7 +375,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
return lldb::eExpressionInterrupted;
}
if (result_valobj_sp.get() == NULL) {
if (result_valobj_sp.get() == nullptr) {
result_valobj_sp = ValueObjectConstResult::Create(
exe_ctx.GetBestExecutionContextScope(), error);
}
+8 -6
View File
@@ -163,7 +163,7 @@ private:
// Use static GetHistory() function to get a EditlineHistorySP to one of
// these objects
EditlineHistory(const std::string &prefix, uint32_t size, bool unique_entries)
: m_history(NULL), m_event(), m_prefix(prefix), m_path() {
: m_history(nullptr), m_event(), m_prefix(prefix), m_path() {
m_history = history_winit();
history_w(m_history, &m_event, H_SETSIZE, size);
if (unique_entries)
@@ -202,7 +202,7 @@ public:
if (m_history) {
history_wend(m_history);
m_history = NULL;
m_history = nullptr;
}
}
@@ -224,7 +224,7 @@ public:
return history_sp;
}
bool IsValid() const { return m_history != NULL; }
bool IsValid() const { return m_history != nullptr; }
HistoryW *GetHistoryPtr() { return m_history; }
@@ -514,11 +514,13 @@ int Editline::GetCharacter(EditLineGetCharType *c) {
// Read returns, immediately lock the mutex again and check if we were
// interrupted.
m_output_mutex.unlock();
int read_count = m_input_connection.Read(&ch, 1, llvm::None, status, NULL);
int read_count =
m_input_connection.Read(&ch, 1, llvm::None, status, nullptr);
m_output_mutex.lock();
if (m_editor_status == EditorStatus::Interrupted) {
while (read_count > 0 && status == lldb::eConnectionStatusSuccess)
read_count = m_input_connection.Read(&ch, 1, llvm::None, status, NULL);
read_count =
m_input_connection.Read(&ch, 1, llvm::None, status, nullptr);
lldbassert(status == lldb::eConnectionStatusInterrupted);
return 0;
}
@@ -1081,7 +1083,7 @@ void Editline::ConfigureEditor(bool multiline) {
// Allow user-specific customization prior to registering bindings we
// absolutely require
el_source(m_editline, NULL);
el_source(m_editline, nullptr);
// Register an internal binding that external developers shouldn't use
el_wset(m_editline, EL_ADDFN, EditLineConstString("lldb-revert-line"),
+4 -4
View File
@@ -65,11 +65,11 @@ static const char *GetStreamOpenModeFromOptions(uint32_t options) {
} else if (options & File::eOpenOptionWrite) {
return "w";
}
return NULL;
return nullptr;
}
int File::kInvalidDescriptor = -1;
FILE *File::kInvalidStream = NULL;
FILE *File::kInvalidStream = nullptr;
File::~File() { Close(); }
@@ -634,9 +634,9 @@ size_t File::Printf(const char *format, ...) {
size_t File::PrintfVarArg(const char *format, va_list args) {
size_t result = 0;
if (DescriptorIsValid()) {
char *s = NULL;
char *s = nullptr;
result = vasprintf(&s, format, args);
if (s != NULL) {
if (s != nullptr) {
if (result > 0) {
size_t s_len = result;
Write(s, s_len);
+4 -4
View File
@@ -112,7 +112,7 @@ HostThread Host::StartMonitoringChildProcess(
::snprintf(thread_name, sizeof(thread_name),
"<lldb.host.wait4(pid=%" PRIu64 ")>", pid);
return ThreadLauncher::LaunchThread(
thread_name, MonitorChildProcessThreadFunction, info_ptr, NULL);
thread_name, MonitorChildProcessThreadFunction, info_ptr, nullptr);
}
#ifndef __linux__
@@ -219,7 +219,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
bool exited = false;
int signal = 0;
int exit_status = 0;
const char *status_cstr = NULL;
const char *status_cstr = nullptr;
if (WIFSTOPPED(status)) {
signal = WSTOPSIG(status);
status_cstr = "STOPPED";
@@ -282,7 +282,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
if (log)
log->Printf("%s (arg = %p) thread exiting...", __FUNCTION__, arg);
return NULL;
return nullptr;
}
#endif // #if !defined (__APPLE__) && !defined (_WIN32)
@@ -393,7 +393,7 @@ const char *Host::GetSignalAsCString(int signo) {
default:
break;
}
return NULL;
return nullptr;
}
#endif
@@ -18,10 +18,10 @@ using namespace lldb;
using namespace lldb_private;
HostNativeThreadBase::HostNativeThreadBase()
: m_thread(LLDB_INVALID_HOST_THREAD), m_result(0) {}
: m_thread(LLDB_INVALID_HOST_THREAD), m_result(nullptr) {}
HostNativeThreadBase::HostNativeThreadBase(thread_t thread)
: m_thread(thread), m_result(0) {}
: m_thread(thread), m_result(nullptr) {}
lldb::thread_t HostNativeThreadBase::GetSystemHandle() const {
return m_thread;
@@ -37,7 +37,7 @@ bool HostNativeThreadBase::IsJoinable() const {
void HostNativeThreadBase::Reset() {
m_thread = LLDB_INVALID_HOST_THREAD;
m_result = 0;
m_result = nullptr;
}
bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const {
@@ -47,7 +47,7 @@ bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const {
lldb::thread_t HostNativeThreadBase::Release() {
lldb::thread_t result = m_thread;
m_thread = LLDB_INVALID_HOST_THREAD;
m_result = 0;
m_result = nullptr;
return result;
}
+3 -3
View File
@@ -55,11 +55,11 @@ std::string OptionParser::GetShortOptionString(struct option *long_options) {
int i = 0;
bool done = false;
while (!done) {
if (long_options[i].name == 0 && long_options[i].has_arg == 0 &&
long_options[i].flag == 0 && long_options[i].val == 0) {
if (long_options[i].name == nullptr && long_options[i].has_arg == 0 &&
long_options[i].flag == nullptr && long_options[i].val == 0) {
done = true;
} else {
if (long_options[i].flag == NULL && isalpha(long_options[i].val)) {
if (long_options[i].flag == nullptr && isalpha(long_options[i].val)) {
s.append(1, (char)long_options[i].val);
switch (long_options[i].has_arg) {
default:
+1 -1
View File
@@ -12,7 +12,7 @@
namespace lldb_private {
ProcessRunLock::ProcessRunLock() : m_running(false) {
int err = ::pthread_rwlock_init(&m_rwlock, NULL);
int err = ::pthread_rwlock_init(&m_rwlock, nullptr);
(void)err;
}
+3 -3
View File
@@ -236,11 +236,11 @@ SocketAddress::GetAddressInfo(const char *hostname, const char *servname,
hints.ai_protocol = ai_protocol;
hints.ai_flags = ai_flags;
struct addrinfo *service_info_list = NULL;
struct addrinfo *service_info_list = nullptr;
int err = ::getaddrinfo(hostname, servname, &hints, &service_info_list);
if (err == 0 && service_info_list) {
for (struct addrinfo *service_ptr = service_info_list; service_ptr != NULL;
service_ptr = service_ptr->ai_next) {
for (struct addrinfo *service_ptr = service_info_list;
service_ptr != nullptr; service_ptr = service_ptr->ai_next) {
addr_list.emplace_back(SocketAddress(service_ptr));
}
}
+2 -2
View File
@@ -143,7 +143,7 @@ Status TCPSocket::Connect(llvm::StringRef name) {
return error;
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
host_str.c_str(), NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
for (auto address : addresses) {
error = CreateSocket(address.GetFamily());
if (error.Fail())
@@ -182,7 +182,7 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
if (host_str == "*")
host_str = "0.0.0.0";
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
host_str.c_str(), NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
for (auto address : addresses) {
int fd = Socket::CreateSocket(address.GetFamily(), kType, IPPROTO_TCP,
m_child_processes_inherit, error);
+1 -1
View File
@@ -73,7 +73,7 @@ void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) {
lldb::thread_result_t TaskPoolImpl::WorkerPtr(void *pool) {
Worker((TaskPoolImpl *)pool);
return 0;
return nullptr;
}
void TaskPoolImpl::Worker(TaskPoolImpl *pool) {
+3 -3
View File
@@ -112,7 +112,7 @@ bool TerminalState::Save(int fd, bool save_process_group) {
m_tflags = ::fcntl(fd, F_GETFL, 0);
#endif
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
if (m_termios_up == NULL)
if (m_termios_up == nullptr)
m_termios_up.reset(new struct termios);
int err = ::tcgetattr(fd, m_termios_up.get());
if (err != 0)
@@ -151,7 +151,7 @@ bool TerminalState::Restore() const {
if (ProcessGroupIsValid()) {
// Save the original signal handler.
void (*saved_sigttou_callback)(int) = NULL;
void (*saved_sigttou_callback)(int) = nullptr;
saved_sigttou_callback = (void (*)(int))signal(SIGTTOU, SIG_IGN);
// Set the process group
tcsetpgrp(fd, m_process_group);
@@ -177,7 +177,7 @@ bool TerminalState::TFlagsIsValid() const { return m_tflags != -1; }
// Returns true if m_ttystate is valid
bool TerminalState::TTYStateIsValid() const {
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
return m_termios_up != 0;
return m_termios_up != nullptr;
#else
return false;
#endif
+1 -1
View File
@@ -49,7 +49,7 @@ HostThread ThreadLauncher::LaunchThread(llvm::StringRef name,
}
#endif
pthread_attr_t *thread_attr_ptr = NULL;
pthread_attr_t *thread_attr_ptr = nullptr;
pthread_attr_t thread_attr;
bool destroy_attr = false;
if (min_stack_byte_size > 0) {
+1 -1
View File
@@ -134,7 +134,7 @@ XMLNode XMLNode::GetChild() const {
llvm::StringRef XMLNode::GetAttributeValue(const char *name,
const char *fail_value) const {
const char *attr_value = NULL;
const char *attr_value = nullptr;
#if defined(LIBXML2_DEFINED)
if (IsValid())
+4 -4
View File
@@ -216,12 +216,12 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
DIR *dirproc = opendir(procdir);
if (dirproc) {
struct dirent *direntry = NULL;
struct dirent *direntry = nullptr;
const uid_t our_uid = getuid();
const lldb::pid_t our_pid = getpid();
bool all_users = match_info.GetMatchAllUsers();
while ((direntry = readdir(dirproc)) != NULL) {
while ((direntry = readdir(dirproc)) != nullptr) {
if (direntry->d_type != DT_DIR || !IsDirNumeric(direntry->d_name))
continue;
@@ -269,8 +269,8 @@ bool Host::FindProcessThreads(const lldb::pid_t pid, TidMap &tids_to_attach) {
DIR *dirproc = opendir(process_task_dir.c_str());
if (dirproc) {
struct dirent *direntry = NULL;
while ((direntry = readdir(dirproc)) != NULL) {
struct dirent *direntry = nullptr;
while ((direntry = readdir(dirproc)) != nullptr) {
if (direntry->d_type != DT_DIR || !IsDirNumeric(direntry->d_name))
continue;
+2 -1
View File
@@ -121,7 +121,8 @@ llvm::StringRef HostInfoLinux::GetDistributionId() {
// retrieve the distribution id string.
char distribution_id[256] = {'\0'};
if (fgets(distribution_id, sizeof(distribution_id) - 1, file) != NULL) {
if (fgets(distribution_id, sizeof(distribution_id) - 1, file) !=
nullptr) {
if (log)
log->Printf("distribution id command returned \"%s\"",
distribution_id);
@@ -111,7 +111,7 @@ ConnectionFileDescriptor::~ConnectionFileDescriptor() {
if (log)
log->Printf("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()",
static_cast<void *>(this));
Disconnect(NULL);
Disconnect(nullptr);
CloseCommandPipe();
}
+1 -1
View File
@@ -29,7 +29,7 @@ Status HostThreadPosix::Join(lldb::thread_result_t *result) {
error.SetError(err, lldb::eErrorTypePOSIX);
} else {
if (result)
*result = NULL;
*result = nullptr;
error.SetError(EINVAL, eErrorTypePOSIX);
}
@@ -1739,7 +1739,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
log->Printf("HandleCommand, (revised) command_string: '%s'",
command_string.c_str());
const bool wants_raw_input =
(cmd_obj != NULL) ? cmd_obj->WantsRawCommandString() : false;
(cmd_obj != nullptr) ? cmd_obj->WantsRawCommandString() : false;
log->Printf("HandleCommand, wants_raw_input:'%s'",
wants_raw_input ? "True" : "False");
}
@@ -2214,7 +2214,7 @@ void CommandInterpreter::SourceInitFileHome(CommandReturnObject &result) {
const char *CommandInterpreter::GetCommandPrefix() {
const char *prefix = GetDebugger().GetIOHandlerCommandPrefix();
return prefix == NULL ? "" : prefix;
return prefix == nullptr ? "" : prefix;
}
PlatformSP CommandInterpreter::GetPlatform(bool prefer_target_platform) {
@@ -3206,7 +3206,7 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
if (!scratch_command.empty())
revised_command_line.Printf(" %s", scratch_command.c_str());
if (cmd_obj != NULL)
if (cmd_obj != nullptr)
command_line = revised_command_line.GetString();
return cmd_obj;
+3 -3
View File
@@ -165,13 +165,13 @@ const OptionValueFormat *OptionValue::GetAsFormat() const {
OptionValueLanguage *OptionValue::GetAsLanguage() {
if (GetType() == OptionValue::eTypeLanguage)
return static_cast<OptionValueLanguage *>(this);
return NULL;
return nullptr;
}
const OptionValueLanguage *OptionValue::GetAsLanguage() const {
if (GetType() == OptionValue::eTypeLanguage)
return static_cast<const OptionValueLanguage *>(this);
return NULL;
return nullptr;
}
OptionValueFormatEntity *OptionValue::GetAsFormatEntity() {
@@ -520,7 +520,7 @@ lldb::OptionValueSP OptionValue::CreateValueFromCStringForTypeMask(
value_sp.reset(new OptionValueFormat(eFormatInvalid));
break;
case 1u << eTypeFormatEntity:
value_sp.reset(new OptionValueFormatEntity(NULL));
value_sp.reset(new OptionValueFormatEntity(nullptr));
break;
case 1u << eTypeLanguage:
value_sp.reset(new OptionValueLanguage(eLanguageTypeUnknown));
@@ -1739,8 +1739,8 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
uint32_t index = 0;
for (index = 0; index < num_children; index++) {
std::string name;
base_type =
compiler_type.GetFieldAtIndex(index, name, NULL, NULL, NULL);
base_type = compiler_type.GetFieldAtIndex(index, name, nullptr,
nullptr, nullptr);
if (base_type.IsFloatingPointType(float_count, is_complex)) {
llvm::Optional<uint64_t> base_byte_size =
@@ -1799,7 +1799,7 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
const RegisterInfo *reg_info =
reg_ctx->GetRegisterInfo(eRegisterKindDWARF, regnum);
if (reg_info == NULL)
if (reg_info == nullptr)
break;
RegisterValue reg_value;
@@ -356,7 +356,7 @@ public:
return;
else {
const uint8_t *bytes = data.PeekData(offset, inst_size);
if (bytes == NULL)
if (bytes == nullptr)
return;
m_opcode_name.assign(".byte");
m_opcode.SetOpcodeBytes(bytes, inst_size);
@@ -956,7 +956,7 @@ DisassemblerLLVMC::MCDisasmInstance::Create(const char *triple, const char *cpu,
return Instance();
std::unique_ptr<llvm::MCContext> context_up(
new llvm::MCContext(asm_info_up.get(), reg_info_up.get(), 0));
new llvm::MCContext(asm_info_up.get(), reg_info_up.get(), nullptr));
if (!context_up)
return Instance();
@@ -1079,7 +1079,7 @@ bool DisassemblerLLVMC::MCDisasmInstance::IsCall(llvm::MCInst &mc_inst) const {
DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
const char *flavor_string)
: Disassembler(arch, flavor_string), m_exe_ctx(NULL), m_inst(NULL),
: Disassembler(arch, flavor_string), m_exe_ctx(nullptr), m_inst(nullptr),
m_data_from_file(false) {
if (!FlavorValidForArchSpec(arch, m_flavor.c_str())) {
m_flavor.assign("default");
@@ -1242,7 +1242,7 @@ Disassembler *DisassemblerLLVMC::CreateInstance(const ArchSpec &arch,
if (disasm_up.get() && disasm_up->IsValid())
return disasm_up.release();
}
return NULL;
return nullptr;
}
size_t DisassemblerLLVMC::DecodeInstructions(const Address &base_addr,
@@ -1329,7 +1329,7 @@ const char *DisassemblerLLVMC::SymbolLookupCallback(void *disassembler,
bool DisassemblerLLVMC::FlavorValidForArchSpec(
const lldb_private::ArchSpec &arch, const char *flavor) {
llvm::Triple triple = arch.GetTriple();
if (flavor == NULL || strcmp(flavor, "default") == 0)
if (flavor == nullptr || strcmp(flavor, "default") == 0)
return true;
if (triple.getArch() == llvm::Triple::x86 ||
@@ -1358,7 +1358,7 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
if (*type_ptr) {
if (m_exe_ctx && m_inst) {
// std::string remove_this_prior_to_checkin;
Target *target = m_exe_ctx ? m_exe_ctx->GetTargetPtr() : NULL;
Target *target = m_exe_ctx ? m_exe_ctx->GetTargetPtr() : nullptr;
Address value_so_addr;
Address pc_so_addr;
if (m_inst->UsingFileAddress()) {
@@ -1423,8 +1423,8 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
}
*type_ptr = LLVMDisassembler_ReferenceType_InOut_None;
*name = NULL;
return NULL;
*name = nullptr;
return nullptr;
}
// PluginInterface protocol
@@ -73,9 +73,9 @@ static constexpr OptionEnumValueElement g_kaslr_kernel_scan_enum_values[] = {
"on 32-bit targets)."}};
static constexpr PropertyDefinition g_properties[] = {
{"load-kexts", OptionValue::eTypeBoolean, true, true, NULL, {},
{"load-kexts", OptionValue::eTypeBoolean, true, true, nullptr, {},
"Automatically loads kext images when attaching to a kernel."},
{"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, NULL,
{"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, nullptr,
OptionEnumValues(g_kaslr_kernel_scan_enum_values),
"Control how many reads lldb will make while searching for a Darwin "
"kernel on attach."}};
@@ -99,13 +99,13 @@ public:
bool GetLoadKexts() const {
const uint32_t idx = ePropertyLoadKexts;
return m_collection_sp->GetPropertyAtIndexAsBoolean(
NULL, idx, g_properties[idx].default_uint_value != 0);
nullptr, idx, g_properties[idx].default_uint_value != 0);
}
KASLRScanType GetScanType() const {
const uint32_t idx = ePropertyScanType;
return (KASLRScanType)m_collection_sp->GetPropertyAtIndexAsEnumeration(
NULL, idx, g_properties[idx].default_uint_value);
nullptr, idx, g_properties[idx].default_uint_value);
}
};
@@ -132,7 +132,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
ObjectFile *object_file = exe_module->GetObjectFile();
if (object_file) {
if (object_file->GetStrata() != ObjectFile::eStrataKernel) {
return NULL;
return nullptr;
}
}
}
@@ -149,7 +149,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
case llvm::Triple::WatchOS:
// NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS:
if (triple_ref.getVendor() != llvm::Triple::Apple) {
return NULL;
return nullptr;
}
break;
// If we have triple like armv7-unknown-unknown, we should try looking for
@@ -157,7 +157,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
case llvm::Triple::UnknownOS:
break;
default:
return NULL;
return nullptr;
break;
}
}
@@ -171,7 +171,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
process->SetCanRunCode(false);
return new DynamicLoaderDarwinKernel(process, kernel_load_address);
}
return NULL;
return nullptr;
}
lldb::addr_t
@@ -198,11 +198,11 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) {
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
Module *exe_module = process->GetTarget().GetExecutableModulePointer();
if (exe_module == NULL)
if (exe_module == nullptr)
return LLDB_INVALID_ADDRESS;
ObjectFile *exe_objfile = exe_module->GetObjectFile();
if (exe_objfile == NULL)
if (exe_objfile == nullptr)
return LLDB_INVALID_ADDRESS;
if (exe_objfile->GetType() != ObjectFile::eTypeExecutable ||
@@ -282,7 +282,7 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
}
ThreadSP thread = process->GetThreadList().GetSelectedThread();
if (thread.get() == NULL)
if (thread.get() == nullptr)
return LLDB_INVALID_ADDRESS;
addr_t pc = thread->GetRegisterContext()->GetPC(LLDB_INVALID_ADDRESS);
@@ -454,7 +454,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
return UUID();
ObjectFile *exe_objfile = memory_module_sp->GetObjectFile();
if (exe_objfile == NULL) {
if (exe_objfile == nullptr) {
if (log)
log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress "
"found a binary at 0x%" PRIx64
@@ -541,7 +541,7 @@ void DynamicLoaderDarwinKernel::Clear(bool clear_process) {
m_process->ClearBreakpointSiteByID(m_break_id);
if (clear_process)
m_process = NULL;
m_process = nullptr;
m_kernel.Clear();
m_known_kexts.clear();
m_kext_summary_header_ptr_addr.Clear();
@@ -638,7 +638,7 @@ UUID DynamicLoaderDarwinKernel::KextImageInfo::GetUUID() const {
bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
Process *process) {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
if (m_memory_module_sp.get() != NULL)
if (m_memory_module_sp.get() != nullptr)
return true;
if (m_load_address == LLDB_INVALID_ADDRESS)
return false;
@@ -658,7 +658,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
ModuleSP memory_module_sp =
process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
if (memory_module_sp.get() == NULL)
if (memory_module_sp.get() == nullptr)
return false;
bool is_kernel = false;
@@ -806,9 +806,9 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
FileSpec kext_filespec(m_name.c_str());
FileSpecList search_paths = target.GetExecutableSearchPaths();
kext_bundle_module_spec.GetFileSpec() = kext_filespec;
platform_sp->GetSharedModule(
kext_bundle_module_spec, process, m_module_sp,
&search_paths, NULL, NULL);
platform_sp->GetSharedModule(kext_bundle_module_spec, process,
m_module_sp, &search_paths, nullptr,
nullptr);
}
}
@@ -1378,7 +1378,7 @@ uint32_t DynamicLoaderDarwinKernel::ReadKextSummaries(
lldb::offset_t offset = kext_summary_offset;
const void *name_data =
extractor.GetData(&offset, KERNEL_MODULE_MAX_NAME);
if (name_data == NULL)
if (name_data == nullptr)
break;
image_infos[i].SetName((const char *)name_data);
UUID uuid = UUID::fromOptionalData(extractor.GetData(&offset, 16), 16);
@@ -1426,7 +1426,7 @@ void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderDarwinKernel::PutToLog(Log *log) const {
if (log == NULL)
if (log == nullptr)
return;
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -1464,7 +1464,7 @@ void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() {
module_spec_list.Append(m_kernel.GetModule()->GetFileSpec());
Breakpoint *bp =
m_process->GetTarget()
.CreateBreakpoint(&module_spec_list, NULL,
.CreateBreakpoint(&module_spec_list, nullptr,
"OSKextLoadedKextSummariesUpdated",
eFunctionNameTypeFull, eLanguageTypeUnknown, 0,
skip_prologue, internal_bp, hardware)
@@ -104,7 +104,7 @@ DynamicLoader *DynamicLoaderHexagonDYLD::CreateInstance(Process *process,
if (create)
return new DynamicLoaderHexagonDYLD(process);
return NULL;
return nullptr;
}
DynamicLoaderHexagonDYLD::DynamicLoaderHexagonDYLD(Process *process)
@@ -420,7 +420,7 @@ DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(Thread &thread,
const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
Symbol *sym = context.symbol;
if (sym == NULL || !sym->IsTrampoline())
if (sym == nullptr || !sym->IsTrampoline())
return thread_plan_sp;
const ConstString sym_name = sym->GetMangled().GetName(
@@ -84,7 +84,7 @@ void DynamicLoaderDarwin::DidLaunch() {
void DynamicLoaderDarwin::Clear(bool clear_process) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (clear_process)
m_process = NULL;
m_process = nullptr;
m_dyld_image_infos.clear();
m_dyld_image_infos_stop_id = UINT32_MAX;
m_dyld.Clear(false);
@@ -115,7 +115,7 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
// We'll call Target::ModulesDidLoad after all the modules have been
// added to the target, don't let it be called for every one.
module_sp = target.GetOrCreateModule(module_spec, false /* notify */);
if (!module_sp || module_sp->GetObjectFile() == NULL)
if (!module_sp || module_sp->GetObjectFile() == nullptr)
module_sp = m_process->ReadModuleFromMemory(image_info.file_spec,
image_info.address);
@@ -533,8 +533,8 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
if (exe_idx != UINT32_MAX) {
const bool can_create = true;
ModuleSP exe_module_sp(
FindTargetModuleForImageInfo(image_infos[exe_idx], can_create, NULL));
ModuleSP exe_module_sp(FindTargetModuleForImageInfo(image_infos[exe_idx],
can_create, nullptr));
if (exe_module_sp) {
if (log)
log->Printf("Found executable module: %s",
@@ -549,8 +549,8 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
if (dyld_idx != UINT32_MAX) {
const bool can_create = true;
ModuleSP dyld_sp =
FindTargetModuleForImageInfo(image_infos[dyld_idx], can_create, NULL);
ModuleSP dyld_sp = FindTargetModuleForImageInfo(image_infos[dyld_idx],
can_create, nullptr);
if (dyld_sp.get()) {
if (log)
log->Printf("Found dyld module: %s",
@@ -567,7 +567,7 @@ void DynamicLoaderDarwin::UpdateDYLDImageInfoFromNewImageInfo(
if (image_info.header.filetype == llvm::MachO::MH_DYLINKER) {
const bool can_create = true;
ModuleSP dyld_sp =
FindTargetModuleForImageInfo(image_info, can_create, NULL);
FindTargetModuleForImageInfo(image_info, can_create, nullptr);
if (dyld_sp.get()) {
Target &target = m_process->GetTarget();
target.GetImages().AppendIfNeeded(dyld_sp);
@@ -605,7 +605,7 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
m_dyld_image_infos.push_back(image_infos[idx]);
ModuleSP image_module_sp(
FindTargetModuleForImageInfo(image_infos[idx], true, NULL));
FindTargetModuleForImageInfo(image_infos[idx], true, nullptr));
if (image_module_sp) {
ObjectFile *objfile = image_module_sp->GetObjectFile();
@@ -628,7 +628,7 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
commpage_image_module_sp = target.GetOrCreateModule(module_spec,
true /* notify */);
if (!commpage_image_module_sp ||
commpage_image_module_sp->GetObjectFile() == NULL) {
commpage_image_module_sp->GetObjectFile() == nullptr) {
commpage_image_module_sp = m_process->ReadModuleFromMemory(
image_infos[idx].file_spec, image_infos[idx].address);
// Always load a memory image right away in the target in case
@@ -686,15 +686,16 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) {
if (sym_ctx.symbol) {
module_sp = sym_ctx.symbol->GetAddressRef().GetModule();
}
if (module_sp.get() == NULL && sym_ctx.function) {
if (module_sp.get() == nullptr && sym_ctx.function) {
module_sp =
sym_ctx.function->GetAddressRange().GetBaseAddress().GetModule();
}
if (module_sp.get() == NULL)
if (module_sp.get() == nullptr)
return false;
ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime();
return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp);
return objc_runtime != nullptr &&
objc_runtime->IsModuleObjCLibrary(module_sp);
}
// Dump a Segment to the file handle provided.
@@ -719,7 +720,7 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(ConstString name) const {
if (segments[i].name == name)
return &segments[i];
}
return NULL;
return nullptr;
}
// Dump an image info structure to the file handle provided.
@@ -791,7 +792,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
TargetSP target_sp(thread.CalculateTarget());
if (current_symbol != NULL) {
if (current_symbol != nullptr) {
std::vector<Address> addresses;
if (current_symbol->IsTrampoline()) {
@@ -68,7 +68,7 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
if (create)
return new DynamicLoaderMacOS(process);
return NULL;
return nullptr;
}
// Constructor
@@ -334,7 +334,7 @@ void DynamicLoaderMacOS::AddBinaries(
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderMacOS::PutToLog(Log *log) const {
if (log == NULL)
if (log == nullptr)
return;
}
@@ -88,7 +88,7 @@ DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
if (create)
return new DynamicLoaderMacOSXDYLD(process);
return NULL;
return nullptr;
}
// Constructor
@@ -608,7 +608,7 @@ bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(
// We'll remove them all at one go later on.
ModuleSP unload_image_module_sp(
FindTargetModuleForImageInfo(image_infos[idx], false, NULL));
FindTargetModuleForImageInfo(image_infos[idx], false, nullptr));
if (unload_image_module_sp.get()) {
// When we unload, be sure to use the image info from the old list,
// since that has sections correctly filled in.
@@ -794,7 +794,7 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr,
if (data.GetU32(&offset, &header->cputype,
(sizeof(llvm::MachO::mach_header) / sizeof(uint32_t)) -
1)) {
if (load_command_data == NULL)
if (load_command_data == nullptr)
return true; // We were able to read the mach_header and weren't asked
// to read the load command bytes
@@ -922,7 +922,7 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
&data))
continue;
ParseLoadCommands(data, image_infos[i], NULL);
ParseLoadCommands(data, image_infos[i], nullptr);
if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE)
exe_idx = i;
@@ -933,8 +933,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
if (exe_idx < image_infos.size()) {
const bool can_create = true;
ModuleSP exe_module_sp(
FindTargetModuleForImageInfo(image_infos[exe_idx], can_create, NULL));
ModuleSP exe_module_sp(FindTargetModuleForImageInfo(image_infos[exe_idx],
can_create, nullptr));
if (exe_module_sp) {
UpdateImageLoadAddress(exe_module_sp.get(), image_infos[exe_idx]);
@@ -969,7 +969,7 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderMacOSXDYLD::PutToLog(Log *log) const {
if (log == NULL)
if (log == nullptr)
return;
std::lock_guard<std::recursive_mutex> guard(m_mutex);
Loaded 100 of 250 files, more files were not shown because too many files have changed in this diff. Show more