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
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() {
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;
}
// 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,
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);
}
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);
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;
}
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 {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetConditionText();
}
- return NULL;
+ return nullptr;
}
void SBBreakpointLocation::SetAutoContinue(bool auto_continue) {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadName();
}
- return NULL;
+ return nullptr;
}
void SBBreakpointLocation::SetQueueName(const char *queue_name) {
loc_sp->GetTarget().GetAPIMutex());
loc_sp->GetQueueName();
}
- return NULL;
+ return nullptr;
}
bool SBBreakpointLocation::IsResolved() {
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) {
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)
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();
if (m_opaque_ptr)
return m_opaque_ptr->GetBroadcasterName().GetCString();
- return NULL;
+ return nullptr;
}
bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
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 {
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);
}
SBCommunication::~SBCommunication() {
if (m_opaque && m_opaque_owned)
delete m_opaque;
- m_opaque = NULL;
+ m_opaque = nullptr;
m_opaque_owned = false;
}
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() {
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;
}
? 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;
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;
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);
}
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,
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;
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 {
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() {
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;
(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;
}
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;
}
if (m_opaque_up)
return m_opaque_up->AsCString();
- return NULL;
+ return nullptr;
}
void SBError::Clear() {
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());
}
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>");
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);
}
if (event_data)
return lldb_event->GetData()->GetFlavor().AsCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBEvent::GetType() 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) {
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);
}
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);
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();
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())
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;
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,
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));
}
}
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();
}
}
return inst_sp->GetMnemonic(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
const char *SBInstruction::GetOperands(SBTarget target) {
}
return inst_sp->GetOperands(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
const char *SBInstruction::GetComment(SBTarget target) {
}
return inst_sp->GetComment(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
size_t SBInstruction::GetByteSize() {
// 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;
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());
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);
}
}
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() {
void SBInstructionList::Print(FILE *out) {
LLDB_RECORD_METHOD(void, SBInstructionList, Print, (FILE *), out);
- if (out == NULL)
+ if (out == nullptr)
return;
}
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();
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();
}
}
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;
}
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);
}
}
if (!success)
- event.reset(NULL);
+ event.reset(nullptr);
return success;
}
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
event.reset(m_opaque_sp->PeekAtNextEvent());
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
event.reset(m_opaque_sp->PeekAtNextEventForBroadcaster(broadcaster.get()));
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
broadcaster.get(), event_type_mask));
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
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);
}
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() {
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();
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
return uuid_cstr;
}
- return NULL;
+ return nullptr;
}
bool SBModule::operator==(const SBModule &rhs) const {
if (symbols)
return symbols->GetSymtab();
}
- return NULL;
+ return nullptr;
}
size_t SBModule::GetNumSymbols() {
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);
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) {
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);
}
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBModule::GetAddressByteSize() {
// 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() {
// 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;
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();
}
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();
}
GetWorkingDirectory);
if (m_opaque_ptr->m_working_dir.empty())
- return NULL;
+ return nullptr;
return m_opaque_ptr->m_working_dir.c_str();
}
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();
}
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() {
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; }
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetWorkingDirectory().GetCString();
- return NULL;
+ return nullptr;
}
bool SBPlatform::SetWorkingDirectory(const char *path) {
return ConstString(arch.GetTriple().getTriple().c_str()).GetCString();
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetOSBuild() {
}
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetOSDescription() {
}
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetHostname() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetHostname();
- return NULL;
+ return nullptr;
}
uint32_t SBPlatform::GetOSMajorVersion() {
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);
LLDB_RECORD_METHOD_CONST(void, SBProcess, ReportEventState,
(const lldb::SBEvent &, FILE *), event, out);
- if (out == NULL)
+ if (out == nullptr)
return;
ProcessSP process_sp(GetSP());
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(
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");
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();
return names[idx].AsCString();
}
}
- return NULL;
+ return nullptr;
}
SBThreadCollection SBProcess::GetHistoryThreads(addr_t addr) {
~QueueImpl() {}
- bool IsValid() { return m_queue_wp.lock() != NULL; }
+ bool IsValid() { return m_queue_wp.lock() != nullptr; }
void Clear() {
m_queue_wp.reset();
}
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();
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() {
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() {
SectionSP section_sp(GetSP());
if (section_sp)
return section_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
lldb::SBSection SBSection::GetParent() {
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(
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
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();
}
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();
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;
}
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
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
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
- return NULL;
+ return nullptr;
}
const char *SBStringList::GetStringAtIndex(size_t idx) const {
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
- return NULL;
+ return nullptr;
}
void SBStringList::Clear() {
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);
}
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;
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();
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())
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;
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");
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,
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));
}
}
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() {
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;
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() {
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;
}
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;
}
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");
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 {
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;
}
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) {
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() {
(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;
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);
}
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 {
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 {
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");
}
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);
}
}
// 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);
(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,
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBTarget::GetDataByteSize() {
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(
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(
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,
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));
}
}
(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
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));
}
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);
}
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);
}
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());
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;
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 =
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);
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);
// 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);
}
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;
}
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,
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())
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())
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);
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) {
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() {
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() {
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());
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;
}
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();
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) {
if (m_opaque_up)
return m_opaque_up->GetName().GetCString();
- return NULL;
+ return nullptr;
}
SBType SBTypeMember::GetType() {
}
TypeMemberImpl &SBTypeMember::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new TypeMemberImpl());
return *m_opaque_up;
}
if (m_opaque_sp)
return m_opaque_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
const char *SBTypeMemberFunction::GetDemangledName() {
return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString();
}
}
- return NULL;
+ return nullptr;
}
const char *SBTypeMemberFunction::GetMangledName() {
if (m_opaque_sp)
return m_opaque_sp->GetMangledName().GetCString();
- return NULL;
+ return nullptr;
}
SBType SBTypeMemberFunction::GetType() {
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() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeCategory, GetName);
if (!IsValid())
- return NULL;
+ return nullptr;
return m_opaque_sp->GetName();
}
if (m_opaque_sp.get())
return m_opaque_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
int64_t SBTypeEnumMember::GetValueAsSigned() {
}
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();
}
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::
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() {
item++;
return item;
}
- return NULL;
+ return nullptr;
}
bool SBTypeFilter::ReplaceExpressionPathAtIndex(uint32_t i, const char *item) {
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() {
LLDB_RECORD_CONSTRUCTOR(SBTypeNameSpecifier, (const char *, bool), name,
is_regex);
- if (name == NULL || (*name) == 0)
+ if (name == nullptr || (*name) == 0)
m_opaque_sp.reset();
}
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();
}
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);
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() {
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();
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() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSynthetic, GetData);
if (!IsValid())
- return NULL;
+ return nullptr;
if (IsClassCode())
return m_opaque_sp->GetPythonCode();
else
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) {
}
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
// 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() {
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)
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) {
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) {
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) {
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) {
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) {
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) {
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) {
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
return value_sp->GetCompilerType().GetOpaqueQualType();
- return NULL;
+ return nullptr;
}
lldb::SBTarget SBValue::GetTarget() {
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() {
}
void SBValueList::CreateIfNeeded() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new ValueListImpl());
}
watchpoint_sp->GetTarget().GetAPIMutex());
return watchpoint_sp->GetConditionText();
}
- return NULL;
+ return nullptr;
}
void SBWatchpoint::SetCondition(const char *condition) {
(const lldb::SBEvent &), event);
return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) !=
- NULL;
+ nullptr;
}
WatchpointEventType
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) {
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
SymbolContext &context,
Address *addr, bool containing) {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
if (!context.target_sp)
return eCallbackReturnContinue;
BreakpointResolver::SetSCMatchesByLine(filter, sc_list, skip_prologue,
m_regex.GetText());
}
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
return Searcher::eCallbackReturnContinue;
}
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;
lldb::SearchDepth
BreakpointResolverScripted::GetDepth() {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
lldb::SearchDepth depth = lldb::eSearchDepthModule;
if (m_implementation_sp) {
ScriptInterpreter *interp = GetScriptInterpreter();
bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
Stream *error_stream,
- CommandReturnObject *result = NULL);
+ CommandReturnObject *result = nullptr);
void GetMultilineExpression();
// Let clients know that this thread is exiting
comm->BroadcastEvent(eBroadcastBitNoMorePendingInput);
comm->BroadcastEvent(eBroadcastBitReadThreadDidExit);
- return NULL;
+ return nullptr;
}
void Communication::SetReadThreadBytesReceivedCallback(
lldb::thread_result_t Debugger::EventHandlerThread(lldb::thread_arg_t arg) {
((Debugger *)arg)->DefaultEventHandler();
- return NULL;
+ return nullptr;
}
bool Debugger::StartEventHandlerThread() {
Debugger *debugger = (Debugger *)arg;
debugger->ExecuteIOHandlers();
debugger->StopEventHandlerThread();
- return NULL;
+ return nullptr;
}
bool Debugger::HasIOHandlerThread() { return m_io_handler_thread.IsJoinable(); }
// 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
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) {
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) {
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;
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
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;
}
}
}
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,
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())
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;
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);
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,
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();
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);
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) {
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
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();
}
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) {
{
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(),
Variable *Value::GetVariable() {
if (m_context_type == eContextTypeVariable)
return static_cast<Variable *>(m_context);
- return NULL;
+ return nullptr;
}
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();
}
if (idx < GetSize()) {
return &(m_values[idx]);
} else
- return NULL;
+ return nullptr;
}
void ValueList::Clear() { m_values.clear(); }
// 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(),
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),
}
ValueObject *child = m_children.GetChildAtIndex(idx);
- if (child != NULL)
+ if (child != nullptr)
return child->GetSP();
}
return child_sp;
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;
summary_options);
}
if (m_summary_str.empty())
- return NULL;
+ return nullptr;
return m_summary_str.c_str();
}
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);
} 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());
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;
}
}
if (m_value_str.empty())
- return NULL;
+ return nullptr;
return m_value_str.c_str();
}
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);
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(); }
if (process)
return process->IsPossibleDynamicValue(*this);
else
- return GetCompilerType().IsPossibleDynamicType(NULL, true, true);
+ return GetCompilerType().IsPossibleDynamicType(nullptr, true, true);
}
bool ValueObject::IsRuntimeSupportValue() {
// 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));
TargetSP target_sp(GetTargetSP());
if (target_sp && !target_sp->GetEnableSyntheticValue()) {
- m_synthetic_value = NULL;
+ m_synthetic_value = nullptr;
return;
}
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)
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)
bool ValueObject::HasSyntheticValue() {
UpdateFormatsIfNeeded();
- if (m_synthetic_children_sp.get() == NULL)
+ if (m_synthetic_children_sp.get() == nullptr)
return false;
CalculateSyntheticValue(true);
else
return GetParent();
}
- return NULL;
+ return nullptr;
}
bool ValueObject::IsBaseClass(uint32_t &depth) {
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:
if ((clear_mask & eClearUserVisibleDataItemsSyntheticChildren) ==
eClearUserVisibleDataItemsSyntheticChildren) {
if (m_synthetic_value)
- m_synthetic_value = NULL;
+ m_synthetic_value = nullptr;
}
if ((clear_mask & eClearUserVisibleDataItemsValidator) ==
if (!m_parent->IsPointerOrReferenceType())
return m_parent->GetSymbolContextScope();
}
- return NULL;
+ return nullptr;
}
lldb::ValueObjectSP
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);
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;
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(
}
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());
lldb::ValueObjectSP
ValueObjectConstResultImpl::Cast(const CompilerType &compiler_type) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
ValueObjectConstResultCast *result_cast =
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) {
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);
: 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());
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
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) {
ValueObjectRegisterSet::ValueObjectRegisterSet(ExecutionContextScope *exe_scope,
lldb::RegisterContextSP ®_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);
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);
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)
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]);
}
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;
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();
}
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();
}
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());
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();
SymbolContextScope *ValueObjectVariable::GetSymbolContextScope() {
if (m_variable_sp)
return m_variable_sp->GetSymbolContextScope();
- return NULL;
+ return nullptr;
}
bool ValueObjectVariable::GetDeclaration(Declaration &decl) {
lldb::TypeCategoryImplSP &entry,
bool allow_create) {
entry = GetFormatManager().GetCategory(category, allow_create);
- return (entry.get() != NULL);
+ return (entry.get() != nullptr);
}
bool DataVisualization::Categories::GetCategory(
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() {
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;
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;
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;
(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;
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;
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;
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());
}
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("...");
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);
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);
// 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
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;
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());
}
}
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);
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);
: 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;
}
// 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 &&
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 {
if (IsLocationList()) {
lldb::offset_t offset = 0;
addr_t pc;
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
if (reg_ctx)
pc = reg_ctx->GetPC();
else {
}
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)
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);
return const_cast<uint8_t *>(
m_frozen_sp->GetDataExtractor().GetDataStart());
}
- return NULL;
+ return nullptr;
}
PersistentExpressionState::~PersistentExpressionState() {}
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(),
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return return_value;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
// 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:
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return false;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
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;
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)
FetchFunctionResults(exe_ctx, args_addr, results);
- if (args_addr_ptr == NULL)
+ if (args_addr_ptr == nullptr)
DeallocateFunctionResults(exe_ctx, args_addr);
return lldb::eExpressionCompleted;
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);
std::string s;
llvm::raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
};
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
std::string s;
raw_string_ostream oss(s);
- module.print(oss, NULL);
+ module.print(oss, nullptr);
oss.flush();
if (target_sp)
return target_sp.get();
- return NULL;
+ return nullptr;
}
IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc,
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() {
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();
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 "
}
}
- 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
return lldb::eExpressionInterrupted;
}
- if (result_valobj_sp.get() == NULL) {
+ if (result_valobj_sp.get() == nullptr) {
result_valobj_sp = ValueObjectConstResult::Create(
exe_ctx.GetBestExecutionContextScope(), error);
}
// 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)
if (m_history) {
history_wend(m_history);
- m_history = NULL;
+ m_history = nullptr;
}
}
return history_sp;
}
- bool IsValid() const { return m_history != NULL; }
+ bool IsValid() const { return m_history != nullptr; }
HistoryW *GetHistoryPtr() { return m_history; }
// 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;
}
// 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"),
} 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(); }
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);
::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__
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";
if (log)
log->Printf("%s (arg = %p) thread exiting...", __FUNCTION__, arg);
- return NULL;
+ return nullptr;
}
#endif // #if !defined (__APPLE__) && !defined (_WIN32)
default:
break;
}
- return NULL;
+ return nullptr;
}
#endif
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;
void HostNativeThreadBase::Reset() {
m_thread = LLDB_INVALID_HOST_THREAD;
- m_result = 0;
+ m_result = nullptr;
}
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;
}
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:
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;
}
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));
}
}
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())
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);
lldb::thread_result_t TaskPoolImpl::WorkerPtr(void *pool) {
Worker((TaskPoolImpl *)pool);
- return 0;
+ return nullptr;
}
void TaskPoolImpl::Worker(TaskPoolImpl *pool) {
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)
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);
// 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
}
#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) {
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())
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;
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;
// 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);
if (log)
log->Printf("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()",
static_cast<void *>(this));
- Disconnect(NULL);
+ Disconnect(nullptr);
CloseCommandPipe();
}
error.SetError(err, lldb::eErrorTypePOSIX);
} else {
if (result)
- *result = NULL;
+ *result = nullptr;
error.SetError(EINVAL, eErrorTypePOSIX);
}
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");
}
const char *CommandInterpreter::GetCommandPrefix() {
const char *prefix = GetDebugger().GetIOHandlerCommandPrefix();
- return prefix == NULL ? "" : prefix;
+ return prefix == nullptr ? "" : prefix;
}
PlatformSP CommandInterpreter::GetPlatform(bool prefer_target_platform) {
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;
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() {
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));
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 =
const RegisterInfo *reg_info =
reg_ctx->GetRegisterInfo(eRegisterKindDWARF, regnum);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
break;
RegisterValue reg_value;
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);
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();
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");
if (disasm_up.get() && disasm_up->IsValid())
return disasm_up.release();
}
- return NULL;
+ return nullptr;
}
size_t DisassemblerLLVMC::DecodeInstructions(const Address &base_addr,
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 ||
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()) {
}
*type_ptr = LLVMDisassembler_ReferenceType_InOut_None;
- *name = NULL;
- return NULL;
+ *name = nullptr;
+ return nullptr;
}
// PluginInterface protocol
"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."}};
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);
}
};
ObjectFile *object_file = exe_module->GetObjectFile();
if (object_file) {
if (object_file->GetStrata() != ObjectFile::eStrataKernel) {
- return NULL;
+ return nullptr;
}
}
}
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
case llvm::Triple::UnknownOS:
break;
default:
- return NULL;
+ return nullptr;
break;
}
}
process->SetCanRunCode(false);
return new DynamicLoaderDarwinKernel(process, kernel_load_address);
}
- return NULL;
+ return nullptr;
}
lldb::addr_t
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 ||
}
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);
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
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();
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;
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;
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);
}
}
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);
// 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);
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)
if (create)
return new DynamicLoaderHexagonDYLD(process);
- return NULL;
+ return nullptr;
}
DynamicLoaderHexagonDYLD::DynamicLoaderHexagonDYLD(Process *process)
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(
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);
// 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);
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",
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",
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);
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();
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
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.
if (segments[i].name == name)
return &segments[i];
}
- return NULL;
+ return nullptr;
}
// Dump an image info structure to the file handle provided.
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()) {
if (create)
return new DynamicLoaderMacOS(process);
- return NULL;
+ return nullptr;
}
// Constructor
// 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;
}
if (create)
return new DynamicLoaderMacOSXDYLD(process);
- return NULL;
+ return nullptr;
}
// Constructor
// 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.
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
&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;
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]);
// 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);
if (create)
return new DynamicLoaderPOSIXDYLD(process);
- return NULL;
+ return nullptr;
}
DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process *process)
const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
Symbol *sym = context.symbol;
- if (sym == NULL || !sym->IsTrampoline())
+ if (sym == nullptr || !sym->IsTrampoline())
return thread_plan_sp;
ConstString sym_name = sym->GetName();
if (m_entry_point != LLDB_INVALID_ADDRESS)
return m_entry_point;
- if (m_auxv == NULL)
+ if (m_auxv == nullptr)
return LLDB_INVALID_ADDRESS;
AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AUXV_AT_ENTRY);
if (create)
return new DynamicLoaderStatic(process);
- return NULL;
+ return nullptr;
}
// Constructor
memcpy(str, m_dump.c_str(), len);
- char *end = NULL;
+ char *end = nullptr;
end = strchr(str, '\n');
ASTResultSynthesizer::ASTResultSynthesizer(ASTConsumer *passthrough,
bool top_level, Target &target)
- : m_ast_context(NULL), m_passthrough(passthrough), m_passthrough_sema(NULL),
- m_target(target), m_sema(NULL), m_top_level(top_level) {
+ : m_ast_context(nullptr), m_passthrough(passthrough),
+ m_passthrough_sema(nullptr), m_target(target), m_sema(nullptr),
+ m_top_level(top_level) {
if (!m_passthrough)
return;
(is_lvalue ? "lvalue" : "rvalue"), s.c_str());
}
- clang::VarDecl *result_decl = NULL;
+ clang::VarDecl *result_decl = nullptr;
if (is_lvalue) {
IdentifierInfo *result_ptr_id;
QualType ptr_qual_type;
- if (expr_qual_type->getAs<ObjCObjectType>() != NULL)
+ if (expr_qual_type->getAs<ObjCObjectType>() != nullptr)
ptr_qual_type = Ctx.getObjCObjectPointerType(expr_qual_type);
else
ptr_qual_type = Ctx.getPointerType(expr_qual_type);
result_decl =
VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(),
- result_ptr_id, ptr_qual_type, NULL, SC_Static);
+ result_ptr_id, ptr_qual_type, nullptr, SC_Static);
if (!result_decl)
return false;
} else {
IdentifierInfo &result_id = Ctx.Idents.get("$__lldb_expr_result");
- result_decl = VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(),
- &result_id, expr_qual_type, NULL, SC_Static);
+ result_decl =
+ VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(), &result_id,
+ expr_qual_type, nullptr, SC_Static);
if (!result_decl)
return false;
}
void ASTResultSynthesizer::ForgetSema() {
- m_sema = NULL;
+ m_sema = nullptr;
if (m_passthrough_sema)
m_passthrough_sema->ForgetSema();
ASTStructExtractor::ASTStructExtractor(ASTConsumer *passthrough,
const char *struct_name,
ClangFunctionCaller &function)
- : m_ast_context(NULL), m_passthrough(passthrough), m_passthrough_sema(NULL),
- m_sema(NULL), m_action(NULL), m_function(function),
- m_struct_name(struct_name) {
+ : m_ast_context(nullptr), m_passthrough(passthrough),
+ m_passthrough_sema(nullptr), m_sema(nullptr), m_action(nullptr),
+ m_function(function), m_struct_name(struct_name) {
if (!m_passthrough)
return;
if (!body_compound_stmt)
return; // do we have to handle this?
- RecordDecl *struct_decl = NULL;
+ RecordDecl *struct_decl = nullptr;
StringRef desired_name(m_struct_name);
}
void ASTStructExtractor::ForgetSema() {
- m_sema = NULL;
- m_action = NULL;
+ m_sema = nullptr;
+ m_action = nullptr;
if (m_passthrough_sema)
m_passthrough_sema->ForgetSema();
ClangASTSource::ClangASTSource(const lldb::TargetSP &target)
: m_import_in_progress(false), m_lookups_enabled(false), m_target(target),
- m_ast_context(NULL), m_active_lexical_decls(), m_active_lookups() {
+ m_ast_context(nullptr), m_active_lexical_decls(), m_active_lookups() {
if (!target->GetUseModernTypeLookup()) {
m_ast_importer_sp = m_target->GetClangASTImporter();
}
return;
}
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
if (m_ast_importer_sp->ResolveDeclOrigin(interface_decl, &original_decl,
&original_ctx)) {
lldb::ProcessSP process(m_target->GetProcessSP());
if (!process)
- return NULL;
+ return nullptr;
ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
if (!language_runtime)
- return NULL;
+ return nullptr;
ConstString class_name(interface_decl->getNameAsString().c_str());
language_runtime->LookupInCompleteClassCache(class_name));
if (!complete_type_sp)
- return NULL;
+ return nullptr;
TypeFromUser complete_type =
TypeFromUser(complete_type_sp->GetFullCompilerType());
complete_type.GetOpaqueQualType();
if (!complete_opaque_type)
- return NULL;
+ return nullptr;
const clang::Type *complete_clang_type =
QualType::getFromOpaquePtr(complete_opaque_type).getTypePtr();
dyn_cast<ObjCInterfaceType>(complete_clang_type);
if (!complete_interface_type)
- return NULL;
+ return nullptr;
ObjCInterfaceDecl *complete_iface_decl(complete_interface_type->getDecl());
current_id, static_cast<const void *>(m_ast_context));
}
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
if (!m_ast_importer_sp->ResolveDeclOrigin(context_decl, &original_decl,
&original_ctx))
template <class D> class TaggedASTDecl {
public:
- TaggedASTDecl() : decl(NULL) {}
+ TaggedASTDecl() : decl(nullptr) {}
TaggedASTDecl(D *_decl) : decl(_decl) {}
- bool IsValid() const { return (decl != NULL); }
+ bool IsValid() const { return (decl != nullptr); }
bool IsInvalid() const { return !IsValid(); }
D *operator->() const { return decl; }
D *decl;
template <class D>
DeclFromUser<D> DeclFromParser<D>::GetOrigin(ClangASTSource &source) {
DeclFromUser<> origin_decl;
- source.ResolveDeclOrigin(this->decl, &origin_decl.decl, NULL);
+ source.ResolveDeclOrigin(this->decl, &origin_decl.decl, nullptr);
if (origin_decl.IsInvalid())
return DeclFromUser<D>();
return DeclFromUser<D>(dyn_cast<D>(origin_decl.decl));
return;
do {
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
m_ast_importer_sp->ResolveDeclOrigin(interface_decl, &original_decl,
&original_ctx);
assert(type && "Type for variable must be valid!");
if (!type.IsValid())
- return NULL;
+ return nullptr;
ClangASTContext *lldb_ast =
llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem());
if (!lldb_ast)
- return NULL;
+ return nullptr;
IdentifierInfo *ii = m_decl_name.getAsIdentifierInfo();
clang::NamedDecl *Decl = VarDecl::Create(
*ast, const_cast<DeclContext *>(m_decl_context), SourceLocation(),
- SourceLocation(), ii, ClangUtil::GetQualType(type), 0, SC_Static);
+ SourceLocation(), ii, ClangUtil::GetQualType(type), nullptr, SC_Static);
m_decls.push_back(Decl);
return Decl;
assert(type && "Type for variable must be valid!");
if (!type.IsValid())
- return NULL;
+ return nullptr;
if (m_function_types.count(type))
- return NULL;
+ return nullptr;
ClangASTContext *lldb_ast =
llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem());
if (!lldb_ast)
- return NULL;
+ return nullptr;
m_function_types.insert(type);
clang::FunctionDecl *func_decl = FunctionDecl::Create(
*ast, context, SourceLocation(), SourceLocation(), decl_name, qual_type,
- NULL, SC_Extern, isInlineSpecified, hasWrittenPrototype,
+ nullptr, SC_Extern, isInlineSpecified, hasWrittenPrototype,
isConstexprSpecified);
// We have to do more than just synthesize the FunctionDecl. We have to
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex) {
QualType arg_qual_type(func_proto_type->getParamType(ArgIndex));
- parm_var_decls.push_back(ParmVarDecl::Create(
- *ast, const_cast<DeclContext *>(context), SourceLocation(),
- SourceLocation(), NULL, arg_qual_type, NULL, SC_Static, NULL));
+ parm_var_decls.push_back(
+ ParmVarDecl::Create(*ast, const_cast<DeclContext *>(context),
+ SourceLocation(), SourceLocation(), nullptr,
+ arg_qual_type, nullptr, SC_Static, nullptr));
}
func_decl->setParams(ArrayRef<ParmVarDecl *>(parm_var_decls));
ClangASTContext::IsOperator(decl_name.getAsString().c_str(), op_kind)) {
if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount(
false, op_kind, func_proto_type->getNumParams()))
- return NULL;
+ return nullptr;
}
m_decls.push_back(func_decl);
return (NamedDecl *)interface_decl;
}
}
- return NULL;
+ return nullptr;
}
void NameSearchContext::AddLookupResult(clang::DeclContextLookupResult result) {
~ClangASTSource() override;
/// Interface stubs.
- clang::Decl *GetExternalDecl(uint32_t) override { return NULL; }
- clang::Stmt *GetExternalDeclStmt(uint64_t) override { return NULL; }
+ clang::Decl *GetExternalDecl(uint32_t) override { return nullptr; }
+ clang::Stmt *GetExternalDeclStmt(uint64_t) override { return nullptr; }
clang::Selector GetExternalSelector(uint32_t) override {
return clang::Selector();
}
uint32_t GetNumExternalSelectors() override { return 0; }
clang::CXXBaseSpecifier *
GetExternalCXXBaseSpecifiers(uint64_t Offset) override {
- return NULL;
+ return nullptr;
}
void MaterializeVisibleDecls(const clang::DeclContext *DC) { return; }
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
ExecutionContext &exe_ctx = m_parser_vars->m_exe_ctx;
Target *target = exe_ctx.GetTargetPtr();
- if (target == NULL)
+ if (target == nullptr)
return false;
ClangASTContext *context(target->GetScratchClangASTContext());
// Clang is looking for the type of "this"
- if (frame == NULL)
+ if (frame == nullptr)
return;
// Find the block that defines the function represented by "sym_ctx"
}
}
if (target) {
- var = FindGlobalVariable(*target, module_sp, name, &namespace_decl, NULL);
+ var = FindGlobalVariable(*target, module_sp, name, &namespace_decl,
+ nullptr);
if (var) {
valobj = ValueObjectVariable::Create(target, var);
}
if (sc_list.GetSize()) {
- Symbol *extern_symbol = NULL;
- Symbol *non_extern_symbol = NULL;
+ Symbol *extern_symbol = nullptr;
+ Symbol *non_extern_symbol = nullptr;
for (uint32_t index = 0, num_indices = sc_list.GetSize();
index < num_indices; ++index) {
if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
continue;
- AddOneFunction(context, sym_ctx.function, NULL, current_id);
+ AddOneFunction(context, sym_ctx.function, nullptr, current_id);
context.m_found.function_with_type_info = true;
context.m_found.function = true;
} else if (sym_ctx.symbol) {
if (sym_ctx.symbol->GetType() == eSymbolTypeReExported && target) {
sym_ctx.symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target);
- if (sym_ctx.symbol == NULL)
+ if (sym_ctx.symbol == nullptr)
continue;
}
if (!context.m_found.function_with_type_info) {
if (extern_symbol) {
- AddOneFunction(context, NULL, extern_symbol, current_id);
+ AddOneFunction(context, nullptr, extern_symbol, current_id);
context.m_found.function = true;
} else if (non_extern_symbol) {
- AddOneFunction(context, NULL, non_extern_symbol, current_id);
+ AddOneFunction(context, nullptr, non_extern_symbol, current_id);
context.m_found.function = true;
}
}
bool is_reference = pt.IsReferenceType();
- NamedDecl *var_decl = NULL;
+ NamedDecl *var_decl = nullptr;
if (is_reference)
var_decl = context.AddVarDecl(pt);
else
entity->GetParserVars(GetParserID());
parser_vars->m_parser_type = pt;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value = var_location;
parser_vars->m_lldb_var = var;
->GetParserVars(GetParserID());
parser_vars->m_parser_type = parser_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value.Clear();
if (log) {
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
- if (target == NULL)
+ if (target == nullptr)
return;
ASTContext *scratch_ast_context =
parser_vars->m_parser_type = parser_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_sym = &symbol;
if (log) {
var_type.getAsOpaquePtr(),
ClangASTContext::GetASTContext(&var_decl->getASTContext()));
- lldb::opaque_compiler_type_t copied_type = 0;
+ lldb::opaque_compiler_type_t copied_type = nullptr;
if (m_ast_importer_sp) {
copied_type = m_ast_importer_sp->CopyType(
scratch_ast_context->getASTContext(), &var_decl->getASTContext(),
entity->GetParserVars(GetParserID());
parser_vars->m_parser_type = parser_clang_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value.Clear();
entity->m_flags |= ClangExpressionVariable::EVBareRegister;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- NamedDecl *function_decl = NULL;
+ NamedDecl *function_decl = nullptr;
Address fun_address;
CompilerType function_clang_type;
}
parser_vars->m_named_decl = function_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
if (log) {
std::string function_str =
CXXMethodDecl *method_decl =
ClangASTContext::GetASTContext(m_ast_context)
->AddMethodToCXXRecordType(
- copied_clang_type.GetOpaqueQualType(), "$__lldb_expr", NULL,
+ copied_clang_type.GetOpaqueQualType(), "$__lldb_expr", nullptr,
method_type, lldb::eAccessPublic, is_virtual, is_static,
is_inline, is_explicit, is_attr_used, is_artificial);
/// \return
/// Valid load address for the symbol
lldb::addr_t GetSymbolAddress(Target &target, Process *process,
- ConstString name,
- lldb::SymbolType symbol_type,
- Module *module = NULL);
+ ConstString name, lldb::SymbolType symbol_type,
+ Module *module = nullptr);
lldb::addr_t GetSymbolAddress(ConstString name,
lldb::SymbolType symbol_type);
return m_exe_ctx.GetTargetPtr();
else if (m_sym_ctx.target_sp)
m_sym_ctx.target_sp.get();
- return NULL;
+ return nullptr;
}
ExecutionContext m_exe_ctx; ///< The execution context to use when parsing.
struct StructVars {
StructVars()
: m_struct_alignment(0), m_struct_size(0), m_struct_laid_out(false),
- m_result_name(), m_object_pointer_type(NULL, NULL) {}
+ m_result_name(), m_object_pointer_type(nullptr, nullptr) {}
lldb::offset_t
m_struct_alignment; ///< The alignment of the struct in bytes.
lldb::VariableSP FindGlobalVariable(Target &target, lldb::ModuleSP &module,
ConstString name,
CompilerDeclContext *namespace_decl,
- TypeFromUser *type = NULL);
+ TypeFromUser *type = nullptr);
/// Get the value of a variable in a given execution context and return the
/// associated Types if needed.
/// Return true if the value was successfully filled in.
bool GetVariableValue(lldb::VariableSP &var,
lldb_private::Value &var_location,
- TypeFromUser *found_type = NULL,
- TypeFromParser *parser_type = NULL);
+ TypeFromUser *found_type = nullptr,
+ TypeFromParser *parser_type = nullptr);
/// Use the NameSearchContext to generate a Decl for the given LLDB
/// Variable, and put it in the Tuple list.
type_system_helper->DeclMap(); // result can be NULL
if (decl_map) {
- Stream *error_stream = NULL;
+ Stream *error_stream = nullptr;
Target *target = exe_ctx.GetTargetPtr();
error_stream = target->GetDebugger().GetErrorFile().get();
class ParserVars {
public:
ParserVars()
- : m_parser_type(), m_named_decl(NULL), m_llvm_value(NULL),
- m_lldb_value(), m_lldb_var(), m_lldb_sym(NULL) {}
+ : m_parser_type(), m_named_decl(nullptr), m_llvm_value(nullptr),
+ m_lldb_value(), m_lldb_var(), m_lldb_sym(nullptr) {}
TypeFromParser
m_parser_type; ///< The type of the variable according to the parser
ParserVarMap::iterator i = m_parser_vars.find(parser_id);
if (i == m_parser_vars.end())
- return NULL;
+ return nullptr;
else
return &i->second;
}
JITVarMap::iterator i = m_jit_vars.find(parser_id);
if (i == m_jit_vars.end())
- return NULL;
+ return nullptr;
else
return &i->second;
}
/// Return the object that the parser should use when resolving external
/// values. May be NULL if everything should be self-contained.
- ClangExpressionDeclMap *DeclMap() override { return NULL; }
+ ClangExpressionDeclMap *DeclMap() override { return nullptr; }
/// Return the object that the parser should allow to access ASTs. May be
/// NULL if the ASTs do not need to be transformed.
return;
name++;
- if (strtoul(name, NULL, 0) == m_next_persistent_variable_id - 1)
+ if (strtoul(name, nullptr, 0) == m_next_persistent_variable_id - 1)
m_next_persistent_variable_id--;
}
m_persistent_decls.find(name.GetCString());
if (i == m_persistent_decls.end())
- return NULL;
+ return nullptr;
else
return i->second;
}
}
StackFrame *frame = exe_ctx.GetFramePtr();
- if (frame == NULL) {
+ if (frame == nullptr) {
if (log)
log->Printf(" [CUE::SC] Null stack frame");
return;
ResetDeclMap(exe_ctx, keep_result_in_memory);
- if (!DeclMap()->WillParse(exe_ctx, NULL)) {
+ if (!DeclMap()->WillParse(exe_ctx, nullptr)) {
diagnostic_manager.PutString(
eDiagnosticSeverityError,
"current process state is unsuitable for expression parsing");
static llvm::Value *FindEntryInstruction(llvm::Function *function) {
if (function->empty())
- return NULL;
+ return nullptr;
return function->getEntryBlock().getFirstNonPHIOrDbg();
}
lldb_private::Stream &error_stream,
const char *func_name)
: ModulePass(ID), m_resolve_vars(resolve_vars), m_func_name(func_name),
- m_module(NULL), m_decl_map(decl_map), m_CFStringCreateWithBytes(NULL),
- m_sel_registerName(NULL), m_objc_getClass(NULL), m_intptr_ty(NULL),
- m_error_stream(error_stream),
- m_execution_unit(execution_unit), m_result_store(NULL),
- m_result_is_pointer(false), m_reloc_placeholder(NULL),
+ m_module(nullptr), m_decl_map(decl_map),
+ m_CFStringCreateWithBytes(nullptr), m_sel_registerName(nullptr),
+ m_objc_getClass(nullptr), m_intptr_ty(nullptr),
+ m_error_stream(error_stream), m_execution_unit(execution_unit),
+ m_result_store(nullptr), m_result_is_pointer(false),
+ m_reloc_placeholder(nullptr),
m_entry_instruction_finder(FindEntryInstruction) {}
/* Handy utility functions used at several places in the code */
module->getNamedMetadata("clang.global.decl.ptrs");
if (!named_metadata)
- return NULL;
+ return nullptr;
unsigned num_nodes = named_metadata->getNumOperands();
unsigned node_index;
llvm::MDNode *metadata_node =
dyn_cast<llvm::MDNode>(named_metadata->getOperand(node_index));
if (!metadata_node)
- return NULL;
+ return nullptr;
if (metadata_node->getNumOperands() != 2)
continue;
mdconst::dyn_extract<ConstantInt>(metadata_node->getOperand(1));
if (!constant_int)
- return NULL;
+ return nullptr;
uintptr_t ptr = constant_int->getZExtValue();
return reinterpret_cast<clang::NamedDecl *>(ptr);
}
- return NULL;
+ return nullptr;
}
clang::NamedDecl *IRForTarget::DeclForGlobal(GlobalValue *global_val) {
ValueSymbolTable &value_symbol_table = m_module->getValueSymbolTable();
std::string result_name_str;
- const char *result_name = NULL;
+ const char *result_name = nullptr;
for (ValueSymbolTable::iterator vi = value_symbol_table.begin(),
ve = value_symbol_table.end();
GlobalVariable *new_result_global = new GlobalVariable(
(*m_module), result_global->getType()->getElementType(),
- false, /* not constant */
- GlobalValue::ExternalLinkage, NULL, /* no initializer */
+ false, /* not constant */
+ GlobalValue::ExternalLinkage, nullptr, /* no initializer */
m_result_name.GetCString());
// It's too late in compilation to create a new VarDecl for this, but we
CFSCWB_ty, ConstantExpr::getIntToPtr(CFSCWB_addr_int, CFSCWB_ptr_ty)};
}
- ConstantDataSequential *string_array = NULL;
+ ConstantDataSequential *string_array = nullptr;
if (cstr)
string_array = dyn_cast<ConstantDataSequential>(cstr->getInitializer());
}
if (!cstr_array)
- cstr_global = NULL;
+ cstr_global = nullptr;
if (!RewriteObjCConstString(nsstring_global, cstr_global)) {
if (log)
return false;
GlobalVariable *persistent_global = new GlobalVariable(
- (*m_module), alloc->getType(), false, /* not constant */
- GlobalValue::ExternalLinkage, NULL, /* no initializer */
+ (*m_module), alloc->getType(), false, /* not constant */
+ GlobalValue::ExternalLinkage, nullptr, /* no initializer */
alloc->getName().str());
// What we're going to do here is make believe this was a regular old
std::string name(named_decl->getName().str());
clang::ValueDecl *value_decl = dyn_cast<clang::ValueDecl>(named_decl);
- if (value_decl == NULL)
+ if (value_decl == nullptr)
return false;
lldb_private::CompilerType compiler_type(&value_decl->getASTContext(),
value_decl->getType());
- const Type *value_type = NULL;
+ const Type *value_type = nullptr;
if (name[0] == '$') {
// The $__lldb_expr_result name indicates the return value has allocated
}
static bool isGuardVariableRef(Value *V) {
- Constant *Old = NULL;
+ Constant *Old = nullptr;
if (!(Old = dyn_cast<Constant>(V)))
return false;
- ConstantExpr *CE = NULL;
+ ConstantExpr *CE = nullptr;
if ((CE = dyn_cast<ConstantExpr>(V))) {
if (CE->getOpcode() != Instruction::BitCast)
}
for (element_index = 0; element_index < num_elements; ++element_index) {
- const clang::NamedDecl *decl = NULL;
- Value *value = NULL;
+ const clang::NamedDecl *decl = nullptr;
+ Value *value = nullptr;
lldb::offset_t offset;
lldb_private::ConstString name;
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
m_reloc_placeholder = new llvm::GlobalVariable(
(*m_module), int8_ty, false /* IsConstant */,
GlobalVariable::InternalLinkage, Constant::getNullValue(int8_ty),
- "reloc_placeholder", NULL /* InsertBefore */,
+ "reloc_placeholder", nullptr /* InsertBefore */,
GlobalVariable::NotThreadLocal /* ThreadLocal */, 0 /* AddressSpace */);
////////////////////////////////////////////////////////////
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM::SetTargetTriple(const ArchSpec &arch) {
(g_arm_opcodes[i].variants & arm_isa) != 0)
return &g_arm_opcodes[i];
}
- return NULL;
+ return nullptr;
}
EmulateInstructionARM::ARMOpcode *
(g_thumb_opcodes[i].variants & arm_isa) != 0)
return &g_thumb_opcodes[i];
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM::SetArchitecture(const ArchSpec &arch) {
}
bool EmulateInstructionARM::EvaluateInstruction(uint32_t evaluate_options) {
- ARMOpcode *opcode_data = NULL;
+ ARMOpcode *opcode_data = nullptr;
if (m_opcode_mode == eModeThumb)
opcode_data =
OptionValueSP value_sp = test_data->GetValueForKey(opcode_key);
uint32_t test_opcode;
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeUInt64)) {
out_stream->Printf("TestEmulation: Error reading opcode from test file.\n");
return false;
EmulationStateARM after_state;
value_sp = test_data->GetValueForKey(before_key);
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeDictionary)) {
out_stream->Printf("TestEmulation: Failed to find 'before' state.\n");
return false;
}
value_sp = test_data->GetValueForKey(after_key);
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeDictionary)) {
out_stream->Printf("TestEmulation: Failed to find 'after' state.\n");
return false;
// Load memory, if present.
- if (value_sp.get() != NULL) {
+ if (value_sp.get() != nullptr) {
static ConstString address_key("address");
static ConstString data_key("data");
uint64_t start_address = 0;
OptionValueDictionary *mem_dict = value_sp->GetAsDictionary();
value_sp = mem_dict->GetValueForKey(address_key);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
else
start_address = value_sp->GetUInt64Value();
for (uint32_t i = 0; i < num_elts; ++i) {
value_sp = mem_array->GetValueAtIndex(i);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t value = value_sp->GetUInt64Value();
StoreToPseudoAddress(address, value);
}
value_sp = test_data->GetValueForKey(registers_key);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
// Load General Registers
sstr.Printf("r%d", i);
ConstString reg_name(sstr.GetString());
value_sp = reg_dict->GetValueForKey(reg_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t reg_value = value_sp->GetUInt64Value();
StorePseudoRegisterValue(dwarf_r0 + i, reg_value);
static ConstString cpsr_name("cpsr");
value_sp = reg_dict->GetValueForKey(cpsr_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
StorePseudoRegisterValue(dwarf_cpsr, value_sp->GetUInt64Value());
sstr.Printf("s%d", i);
ConstString reg_name(sstr.GetString());
value_sp = reg_dict->GetValueForKey(reg_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t reg_value = value_sp->GetUInt64Value();
StorePseudoRegisterValue(dwarf_s0 + i, reg_value);
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM64::SetTargetTriple(const ArchSpec &arch) {
bool EmulateInstructionARM64::EvaluateInstruction(uint32_t evaluate_options) {
const uint32_t opcode = m_opcode.GetOpcode32();
Opcode *opcode_data = GetOpcodeForInstruction(opcode);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
// printf ("opcode template for 0x%8.8x: %s\n", opcode, opcode_data->name);
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS::SetTargetTriple(const ArchSpec &arch) {
return &g_opcodes[i];
}
- return NULL;
+ return nullptr;
}
uint32_t
*/
const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
- if (op_name == NULL)
+ if (op_name == nullptr)
return false;
/*
*/
MipsOpcode *opcode_data = GetOpcodeForInstruction(op_name);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
uint64_t old_pc = 0, new_pc = 0;
bool success = false, branch_hit = true;
int32_t target = 0;
RegisterValue reg_value;
- const uint8_t *ptr = NULL;
+ const uint8_t *ptr = nullptr;
uint32_t wt = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
int32_t offset = insn.getOperand(1).getImm();
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS64::SetTargetTriple(const ArchSpec &arch) {
return &g_opcodes[i];
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS64::ReadInstruction() {
*/
const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
- if (op_name == NULL)
+ if (op_name == nullptr)
return false;
/*
*/
MipsOpcode *opcode_data = GetOpcodeForInstruction(op_name);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
uint64_t old_pc = 0, new_pc = 0;
bool success = false, branch_hit = true;
int64_t target = 0;
RegisterValue reg_value;
- const uint8_t *ptr = NULL;
+ const uint8_t *ptr = nullptr;
uint32_t wt = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
int64_t offset = insn.getOperand(1).getImm();
const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType(
symbol_name, eSymbolTypeCode);
- if (symbol == NULL)
+ if (symbol == nullptr)
return;
if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())
const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType(
symbol_name, eSymbolTypeCode);
- if (symbol == NULL)
+ if (symbol == nullptr)
return;
if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())
bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
const bool check_cxx = true;
const bool check_objc = false;
- return in_value.GetCompilerType().IsPossibleDynamicType(NULL, check_cxx,
+ return in_value.GetCompilerType().IsPossibleDynamicType(nullptr, check_cxx,
check_objc);
}
target.GetImages().ResolveSymbolContextForAddress(
vtable_addr, eSymbolContextSymbol, sc);
Symbol *symbol = sc.symbol;
- if (symbol != NULL) {
+ if (symbol != nullptr) {
const char *name =
symbol->GetMangled()
.GetDemangledName(lldb::eLanguageTypeC_plus_plus)
}
bool ItaniumABILanguageRuntime::IsVTableName(const char *name) {
- if (name == NULL)
+ if (name == nullptr)
return false;
// Can we maybe ask Clang about this?
language == eLanguageTypeC_plus_plus_14)
return new ItaniumABILanguageRuntime(process);
else
- return NULL;
+ return nullptr;
}
class CommandObjectMultiwordItaniumABI_Demangle : public CommandObjectParsed {
Target &target = m_process->GetTarget();
FileSpecList filter_modules;
BreakpointResolverSP exception_resolver_sp =
- CreateExceptionResolver(NULL, catch_bp, throw_bp, for_expressions);
+ CreateExceptionResolver(nullptr, catch_bp, throw_bp, for_expressions);
SearchFilterSP filter_sp(CreateExceptionSearchFilter());
const bool hardware = false;
const bool resolve_indirect_functions = false;
m_runtime.GetClassDescriptorFromISA(isa);
if (!descriptor)
- return NULL;
+ return nullptr;
ConstString name(descriptor->GetClassName());
ObjCRuntimeMethodType(const char *types) : m_is_valid(false) {
const char *cursor = types;
enum ParserState { Start = 0, InType, InPos } state = Start;
- const char *type = NULL;
+ const char *type = nullptr;
int brace_depth = 0;
uint32_t stepsLeft = 256;
m_is_valid = false;
return;
}
- type = NULL;
+ type = nullptr;
} else {
++cursor;
}
bool instance,
ObjCLanguageRuntime::EncodingToTypeSP type_realizer_sp) {
if (!m_is_valid || m_type_vector.size() < 3)
- return NULL;
+ return nullptr;
clang::ASTContext &ast_ctx(interface_decl->getASTContext());
clang::IdentifierInfo **identifier_infos = selector_components.data();
if (!identifier_infos) {
- return NULL;
+ return nullptr;
}
clang::Selector sel = ast_ctx.Selectors.getSelector(
for_expression));
if (ret_type.isNull())
- return NULL;
+ return nullptr;
clang::ObjCMethodDecl *ret = clang::ObjCMethodDecl::Create(
ast_ctx, clang::SourceLocation(), clang::SourceLocation(), sel,
- ret_type, NULL, interface_decl, isInstance, isVariadic, isSynthesized,
- isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType);
+ ret_type, nullptr, interface_decl, isInstance, isVariadic,
+ isSynthesized, isImplicitlyDeclared, isDefined, impControl,
+ HasRelatedResultType);
std::vector<clang::ParmVarDecl *> parm_vars;
ast_ctx, m_type_vector[ai].c_str(), for_expression));
if (arg_type.isNull())
- return NULL; // well, we just wasted a bunch of time. Wish we could
- // delete the stuff we'd just made!
+ return nullptr; // well, we just wasted a bunch of time. Wish we could
+ // delete the stuff we'd just made!
parm_vars.push_back(clang::ParmVarDecl::Create(
- ast_ctx, ret, clang::SourceLocation(), clang::SourceLocation(), NULL,
- arg_type, NULL, clang::SC_None, NULL));
+ ast_ctx, ret, clang::SourceLocation(), clang::SourceLocation(),
+ nullptr, arg_type, nullptr, clang::SC_None, nullptr));
}
ret->setMethodParams(ast_ctx,
clang::SourceLocation(), &m_ast_ctx.getASTContext()->Idents.get(name),
ClangUtil::GetQualType(ivar_type),
type_source_info, // TypeSourceInfo *
- clang::ObjCIvarDecl::Public, 0, is_synthesized);
+ clang::ObjCIvarDecl::Public, nullptr, is_synthesized);
if (ivar_decl) {
interface_decl->addDecl(ivar_decl);
// ret.SetContext(Value::eContextTypeClangType, return_compiler_type);
ret.SetCompilerType(return_compiler_type);
- if (exe_ctx.GetFramePtr() == NULL) {
+ if (exe_ctx.GetFramePtr() == nullptr) {
Thread *thread = exe_ctx.GetThreadPtr();
- if (thread == NULL) {
+ if (thread == nullptr) {
exe_ctx.SetThreadSP(process->GetThreadList().GetSelectedThread());
thread = exe_ctx.GetThreadPtr();
}
eSymbolTypeCode, contexts)) &&
(!modules.FindSymbolsWithNameAndType(ConstString("_CFPrintForDebugger"),
eSymbolTypeCode, contexts)))
- return NULL;
+ return nullptr;
contexts.GetContextAtIndex(0, context);
bool AppleObjCRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
return in_value.GetCompilerType().IsPossibleDynamicType(
- NULL,
+ nullptr,
false, // do not check C++
true); // check ObjC
}
// reread it?
m_objc_trampoline_handler_up.reset(
new AppleObjCTrampolineHandler(m_process->shared_from_this(), module_sp));
- if (m_objc_trampoline_handler_up != NULL) {
+ if (m_objc_trampoline_handler_up != nullptr) {
m_read_objc_library = true;
return true;
} else
ObjCRuntimeVersions::eAppleObjC_V1)
return new AppleObjCRuntimeV1(process);
else
- return NULL;
+ return nullptr;
} else
- return NULL;
+ return nullptr;
}
void AppleObjCRuntimeV1::Initialize() {
m_encoding_to_type_sp(), m_noclasses_warning_emitted(false),
m_CFBoolean_values() {
static const ConstString g_gdb_object_getClass("gdb_object_getClass");
- m_has_object_getClass = (objc_module_sp->FindFirstSymbolWithNameAndType(
- g_gdb_object_getClass, eSymbolTypeCode) != NULL);
+ m_has_object_getClass =
+ (objc_module_sp->FindFirstSymbolWithNameAndType(
+ g_gdb_object_getClass, eSymbolTypeCode) != nullptr);
RegisterObjCExceptionRecognizer();
}
TypeAndOrName &class_type_or_name, Address &address,
Value::ValueType &value_type) {
// We should never get here with a null process...
- assert(m_process != NULL);
+ assert(m_process != nullptr);
// The Runtime is attached to a particular process, you shouldn't pass in a
// value from another process. Note, however, the process might be NULL (e.g.
ObjCRuntimeVersions::eAppleObjC_V2)
return new AppleObjCRuntimeV2(process, objc_module_sp);
else
- return NULL;
+ return nullptr;
} else
- return NULL;
+ return nullptr;
}
static constexpr OptionDefinition g_objc_classtable_dump_options[] = {
public:
RemoteNXMapTable()
: m_count(0), m_num_buckets_minus_one(0),
- m_buckets_ptr(LLDB_INVALID_ADDRESS), m_process(NULL),
+ m_buckets_ptr(LLDB_INVALID_ADDRESS), m_process(nullptr),
m_end_iterator(*this, -1), m_load_addr(LLDB_INVALID_ADDRESS),
m_map_pair_size(0), m_invalid_key(0) {}
RemoteNXMapTable &hash_table) {
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return DescriptorMapUpdateResult::Fail();
uint32_t num_class_infos = 0;
} else {
// Read the 32 bit hash for the class name
const uint32_t name_hash = data.GetU32(&offset);
- ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
+ ClassDescriptorSP descriptor_sp(
+ new ClassDescriptorV2(*this, isa, nullptr));
// The code in g_get_shared_cache_class_info_body sets the value of the hash
// to 0 to signal a demangled symbol. We use class_getName() in that code to
AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() {
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return DescriptorMapUpdateResult::Fail();
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return false;
uint32_t num_map_table_isas = 0;
auto objc_debug_isa_magic_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_magic_mask"), objc_module_sp, error);
if (error.Fail())
- return NULL;
+ return nullptr;
auto objc_debug_isa_magic_value = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_magic_value"), objc_module_sp,
error);
if (error.Fail())
- return NULL;
+ return nullptr;
auto objc_debug_isa_class_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_class_mask"), objc_module_sp, error);
if (error.Fail())
- return NULL;
+ return nullptr;
if (log)
log->PutCString("AOCRT::NPI: Found all the non-indexed ISA masks");
const Symbol *trampoline_symbol =
m_objc_module_sp->FindFirstSymbolWithNameAndType(trampoline_name,
eSymbolTypeData);
- if (trampoline_symbol != NULL) {
+ if (trampoline_symbol != nullptr) {
m_trampoline_header = trampoline_symbol->GetLoadAddress(&target);
if (m_trampoline_header == LLDB_INVALID_ADDRESS)
return false;
const Symbol *changed_symbol =
m_objc_module_sp->FindFirstSymbolWithNameAndType(changed_name,
eSymbolTypeCode);
- if (changed_symbol != NULL) {
+ if (changed_symbol != nullptr) {
const Address changed_symbol_addr = changed_symbol->GetAddress();
if (!changed_symbol_addr.IsValid())
return false;
Status error;
DataExtractor data;
error = argument_values.GetValueAtIndex(0)->GetValueAsData(&exe_ctx, data,
- 0, NULL);
+ 0, nullptr);
lldb::offset_t offset = 0;
lldb::addr_t region_addr = data.GetPointer(&offset);
ConstString msg_forward_name("_objc_msgForward");
ConstString msg_forward_stret_name("_objc_msgForward_stret");
- Target *target = process_sp ? &process_sp->GetTarget() : NULL;
+ Target *target = process_sp ? &process_sp->GetTarget() : nullptr;
const Symbol *class_getMethodImplementation =
m_objc_module_sp->FindFirstSymbolWithNameAndType(get_impl_name,
eSymbolTypeCode);
// First stage is to make the ClangUtility to hold our injected function:
if (!m_impl_code) {
- if (m_lookup_implementation_function_code != NULL) {
+ if (m_lookup_implementation_function_code != nullptr) {
Status error;
m_impl_code.reset(exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
m_lookup_implementation_function_code, eLanguageTypeObjC,
lldb::StackFrameSP thread_cur_frame = thread.GetStackFrameAtIndex(0);
- const ABI *abi = NULL;
+ const ABI *abi = nullptr;
ProcessSP process_sp(thread.CalculateProcess());
if (process_sp)
abi = process_sp->GetABI().get();
- if (abi == NULL)
+ if (abi == nullptr)
return ret_plan_sp;
TargetSP target_sp(thread.CalculateTarget());
}
ObjCLanguageRuntime *objc_runtime =
thread.GetProcess()->GetObjCLanguageRuntime();
- assert(objc_runtime != NULL);
+ assert(objc_runtime != nullptr);
impl_addr = objc_runtime->LookupInMethodCache(isa_addr, sel_addr);
}
class VTableRegion {
public:
VTableRegion()
- : m_valid(false), m_owner(NULL), m_header_addr(LLDB_INVALID_ADDRESS),
- m_code_start_addr(0), m_code_end_addr(0), m_next_region(0) {}
+ : m_valid(false), m_owner(nullptr),
+ m_header_addr(LLDB_INVALID_ADDRESS), m_code_start_addr(0),
+ m_code_end_addr(0), m_next_region(0) {}
VTableRegion(AppleObjCVTables *owner, lldb::addr_t header_addr);
eVoteNoOpinion),
m_trampoline_handler(trampoline_handler),
m_args_addr(LLDB_INVALID_ADDRESS), m_input_values(input_values),
- m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(NULL),
+ m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(nullptr),
m_stop_others(stop_others) {}
// Destructor
ObjCLanguageRuntime *objc_runtime =
GetThread().GetProcess()->GetObjCLanguageRuntime();
- assert(objc_runtime != NULL);
+ assert(objc_runtime != nullptr);
objc_runtime->AddToMethodCache(m_isa_addr, m_sel_addr, target_addr);
if (log)
log->Printf("Adding {isa-addr=0x%" PRIx64 ", sel-addr=0x%" PRIx64
MemoryHistorySP MemoryHistoryASan::CreateInstance(const ProcessSP &process_sp) {
if (!process_sp.get())
- return NULL;
+ return nullptr;
Target &target = process_sp->GetTarget();
if (ar_name_len > 0) {
const void *ar_name_ptr = data.GetData(&offset, ar_name_len);
// Make sure there was enough data for the string value and bail if not
- if (ar_name_ptr == NULL)
+ if (ar_name_ptr == nullptr)
return LLDB_INVALID_OFFSET;
str.assign((const char *)ar_name_ptr, ar_name_len);
ar_name.SetCString(str.c_str());
return &m_objects[match->value];
}
}
- return NULL;
+ return nullptr;
}
ObjectContainerBSDArchive::Archive::shared_ptr
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectContainerBSDArchive::MagicBytesMatch(const DataExtractor &data) {
ObjectContainerBSDArchive::~ObjectContainerBSDArchive() {}
bool ObjectContainerBSDArchive::ParseHeader() {
- if (m_archive_sp.get() == NULL) {
+ if (m_archive_sp.get() == nullptr) {
if (m_data.GetByteSize() > 0) {
ModuleSP module_sp(GetModule());
if (module_sp) {
m_data.Clear();
}
}
- return m_archive_sp.get() != NULL;
+ return m_archive_sp.get() != nullptr;
}
void ObjectContainerBSDArchive::Dump(Stream *s) const {
const Object *GetObjectAtIndex(size_t idx) {
if (idx < m_objects.size())
return &m_objects[idx];
- return NULL;
+ return nullptr;
}
size_t ParseObjects();
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectContainerUniversalMachO::MagicBytesMatch(const DataExtractor &data) {
bool ELFHeader::Parse(lldb_private::DataExtractor &data,
lldb::offset_t *offset) {
// Read e_ident. This provides byte order and address size info.
- if (data.GetU8(offset, &e_ident, EI_NIDENT) == NULL)
+ if (data.GetU8(offset, &e_ident, EI_NIDENT) == nullptr)
return false;
const unsigned byte_size = Is32Bit() ? 4 : 8;
data.SetAddressByteSize(byte_size);
// Read e_type and e_machine.
- if (data.GetU16(offset, &e_type, 2) == NULL)
+ if (data.GetU16(offset, &e_type, 2) == nullptr)
return false;
// Read e_version.
- if (data.GetU32(offset, &e_version, 1) == NULL)
+ if (data.GetU32(offset, &e_version, 1) == nullptr)
return false;
// Read e_entry, e_phoff and e_shoff.
return false;
// Read e_flags.
- if (data.GetU32(offset, &e_flags, 1) == NULL)
+ if (data.GetU32(offset, &e_flags, 1) == nullptr)
return false;
// Read e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum and e_shstrndx.
- if (data.GetU16(offset, &e_ehsize, 6) == NULL)
+ if (data.GetU16(offset, &e_ehsize, 6) == nullptr)
return false;
// Initialize e_phnum, e_shnum, and e_shstrndx with the values read from the
const unsigned byte_size = data.GetAddressByteSize();
// Read sh_name and sh_type.
- if (data.GetU32(offset, &sh_name, 2) == NULL)
+ if (data.GetU32(offset, &sh_name, 2) == nullptr)
return false;
// Read sh_flags.
return false;
// Read sh_link and sh_info.
- if (data.GetU32(offset, &sh_link, 2) == NULL)
+ if (data.GetU32(offset, &sh_link, 2) == nullptr)
return false;
// Read sh_addralign and sh_entsize.
const bool parsing_32 = byte_size == 4;
// Read st_name.
- if (data.GetU32(offset, &st_name, 1) == NULL)
+ if (data.GetU32(offset, &st_name, 1) == nullptr)
return false;
if (parsing_32) {
return false;
// Read st_info and st_other.
- if (data.GetU8(offset, &st_info, 2) == NULL)
+ if (data.GetU8(offset, &st_info, 2) == nullptr)
return false;
// Read st_shndx.
- if (data.GetU16(offset, &st_shndx, 1) == NULL)
+ if (data.GetU16(offset, &st_shndx, 1) == nullptr)
return false;
} else {
// Read st_info and st_other.
- if (data.GetU8(offset, &st_info, 2) == NULL)
+ if (data.GetU8(offset, &st_info, 2) == nullptr)
return false;
// Read st_shndx.
- if (data.GetU16(offset, &st_shndx, 1) == NULL)
+ if (data.GetU16(offset, &st_shndx, 1) == nullptr)
return false;
// Read st_value and st_size.
- if (data.GetU64(offset, &st_value, 2) == NULL)
+ if (data.GetU64(offset, &st_value, 2) == nullptr)
return false;
}
return true;
const bool parsing_32 = byte_size == 4;
// Read p_type;
- if (data.GetU32(offset, &p_type, 1) == NULL)
+ if (data.GetU32(offset, &p_type, 1) == nullptr)
return false;
if (parsing_32) {
return false;
// Read p_flags.
- if (data.GetU32(offset, &p_flags, 1) == NULL)
+ if (data.GetU32(offset, &p_flags, 1) == nullptr)
return false;
// Read p_align.
return false;
} else {
// Read p_flags.
- if (data.GetU32(offset, &p_flags, 1) == NULL)
+ if (data.GetU32(offset, &p_flags, 1) == nullptr)
return false;
// Read p_offset, p_vaddr, p_paddr, p_filesz, p_memsz and p_align.
reloc = new ELFRela();
else {
assert(false && "unexpected relocation type");
- reloc = static_cast<ELFRel *>(NULL);
+ reloc = static_cast<ELFRel *>(nullptr);
}
}
bool ELFNote::Parse(const DataExtractor &data, lldb::offset_t *offset) {
// Read all fields.
- if (data.GetU32(offset, &n_namesz, 3) == NULL)
+ if (data.GetU32(offset, &n_namesz, 3) == nullptr)
return false;
// The name field is required to be nul-terminated, and n_namesz includes the
}
const char *cstr = data.GetCStr(offset, llvm::alignTo(n_namesz, 4));
- if (cstr == NULL) {
+ if (cstr == nullptr) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS));
if (log)
log->Printf("Failed to parse note name lacking nul terminator");
return objfile_up.release();
}
- return NULL;
+ return nullptr;
}
ObjectFile *ObjectFileELF::CreateMemoryInstance(
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectFileELF::MagicBytesMatch(DataBufferSP &data_sp,
const ObjectFileELF::ELFSectionHeaderInfo *
ObjectFileELF::GetSectionHeaderByIndex(lldb::user_id_t id) {
if (!ParseSectionHeaders())
- return NULL;
+ return nullptr;
if (id < m_section_headers.size())
return &m_section_headers[id];
- return NULL;
+ return nullptr;
}
lldb::user_id_t ObjectFileELF::GetSectionIndexByName(const char *name) {
const ELFDynamic *ObjectFileELF::FindDynamicSymbol(unsigned tag) {
if (!ParseDynamicSymbols())
- return NULL;
+ return nullptr;
DynamicSymbolCollIter I = m_dynamic_symbols.begin();
DynamicSymbolCollIter E = m_dynamic_symbols.end();
return symbol;
}
- return NULL;
+ return nullptr;
}
unsigned ObjectFileELF::PLTRelocationType() {
if (!rel.Parse(rel_data, &offset))
break;
- Symbol *symbol = NULL;
+ Symbol *symbol = nullptr;
if (hdr->Is32Bit()) {
switch (reloc_type(rel)) {
Symtab *ObjectFileELF::GetSymtab() {
ModuleSP module_sp(GetModule());
if (!module_sp)
- return NULL;
+ return nullptr;
// We always want to use the main object file so we (hopefully) only have one
// cached copy of our symtab, dynamic sections, etc.
if (module_obj_file && module_obj_file != this)
return module_obj_file->GetSymtab();
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
SectionList *section_list = module_sp->GetSectionList();
if (!section_list)
- return NULL;
+ return nullptr;
uint64_t symbol_id = 0;
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
s->EOL();
SectionList *section_list = GetSectionList();
if (section_list)
- section_list->Dump(s, NULL, true, UINT32_MAX);
+ section_list->Dump(s, nullptr, true, UINT32_MAX);
Symtab *symtab = GetSymtab();
if (symtab)
- symtab->Dump(s, NULL, eSortOrderNone);
+ symtab->Dump(s, nullptr, eSortOrderNone);
s->EOL();
DumpDependentModules(s);
s->EOL();
lldb::offset_t length) {
// JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
// a file
- return NULL;
+ return nullptr;
}
ObjectFile *ObjectFileJIT::CreateMemoryInstance(const lldb::ModuleSP &module_sp,
lldb::addr_t header_addr) {
// JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
// memory
- return NULL;
+ return nullptr;
}
size_t ObjectFileJIT::GetModuleSpecifications(
ObjectFileJIT::ObjectFileJIT(const lldb::ModuleSP &module_sp,
const ObjectFileJITDelegateSP &delegate_sp)
- : ObjectFile(module_sp, NULL, 0, 0, DataBufferSP(), 0), m_delegate_wp() {
+ : ObjectFile(module_sp, nullptr, 0, 0, DataBufferSP(), 0), m_delegate_wp() {
if (delegate_sp) {
m_delegate_wp = delegate_sp;
m_data.SetByteOrder(delegate_sp->GetByteOrder());
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> symtab_guard(
m_symtab_up->GetMutex());
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
}
}
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "rax", NULL, 8, data);
- WriteRegister(reg_ctx, "rbx", NULL, 8, data);
- WriteRegister(reg_ctx, "rcx", NULL, 8, data);
- WriteRegister(reg_ctx, "rdx", NULL, 8, data);
- WriteRegister(reg_ctx, "rdi", NULL, 8, data);
- WriteRegister(reg_ctx, "rsi", NULL, 8, data);
- WriteRegister(reg_ctx, "rbp", NULL, 8, data);
- WriteRegister(reg_ctx, "rsp", NULL, 8, data);
- WriteRegister(reg_ctx, "r8", NULL, 8, data);
- WriteRegister(reg_ctx, "r9", NULL, 8, data);
- WriteRegister(reg_ctx, "r10", NULL, 8, data);
- WriteRegister(reg_ctx, "r11", NULL, 8, data);
- WriteRegister(reg_ctx, "r12", NULL, 8, data);
- WriteRegister(reg_ctx, "r13", NULL, 8, data);
- WriteRegister(reg_ctx, "r14", NULL, 8, data);
- WriteRegister(reg_ctx, "r15", NULL, 8, data);
- WriteRegister(reg_ctx, "rip", NULL, 8, data);
- WriteRegister(reg_ctx, "rflags", NULL, 8, data);
- WriteRegister(reg_ctx, "cs", NULL, 8, data);
- WriteRegister(reg_ctx, "fs", NULL, 8, data);
- WriteRegister(reg_ctx, "gs", NULL, 8, data);
+ WriteRegister(reg_ctx, "rax", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rbx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rcx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rdx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rdi", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rsi", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rbp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rsp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r8", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r9", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r10", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r11", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r12", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r13", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r14", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r15", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rip", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rflags", nullptr, 8, data);
+ WriteRegister(reg_ctx, "cs", nullptr, 8, data);
+ WriteRegister(reg_ctx, "fs", nullptr, 8, data);
+ WriteRegister(reg_ctx, "gs", nullptr, 8, data);
// // Write out the FPU registers
// const size_t fpu_byte_size = sizeof(FPU);
// Write out the EXC registers
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
- WriteRegister(reg_ctx, "trapno", NULL, 4, data);
- WriteRegister(reg_ctx, "err", NULL, 4, data);
- WriteRegister(reg_ctx, "faultvaddr", NULL, 8, data);
+ WriteRegister(reg_ctx, "trapno", nullptr, 4, data);
+ WriteRegister(reg_ctx, "err", nullptr, 4, data);
+ WriteRegister(reg_ctx, "faultvaddr", nullptr, 8, data);
return true;
}
return false;
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "eax", NULL, 4, data);
- WriteRegister(reg_ctx, "ebx", NULL, 4, data);
- WriteRegister(reg_ctx, "ecx", NULL, 4, data);
- WriteRegister(reg_ctx, "edx", NULL, 4, data);
- WriteRegister(reg_ctx, "edi", NULL, 4, data);
- WriteRegister(reg_ctx, "esi", NULL, 4, data);
- WriteRegister(reg_ctx, "ebp", NULL, 4, data);
- WriteRegister(reg_ctx, "esp", NULL, 4, data);
- WriteRegister(reg_ctx, "ss", NULL, 4, data);
- WriteRegister(reg_ctx, "eflags", NULL, 4, data);
- WriteRegister(reg_ctx, "eip", NULL, 4, data);
- WriteRegister(reg_ctx, "cs", NULL, 4, data);
- WriteRegister(reg_ctx, "ds", NULL, 4, data);
- WriteRegister(reg_ctx, "es", NULL, 4, data);
- WriteRegister(reg_ctx, "fs", NULL, 4, data);
- WriteRegister(reg_ctx, "gs", NULL, 4, data);
+ WriteRegister(reg_ctx, "eax", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ebx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ecx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "edx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "edi", nullptr, 4, data);
+ WriteRegister(reg_ctx, "esi", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ebp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "esp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ss", nullptr, 4, data);
+ WriteRegister(reg_ctx, "eflags", nullptr, 4, data);
+ WriteRegister(reg_ctx, "eip", nullptr, 4, data);
+ WriteRegister(reg_ctx, "cs", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ds", nullptr, 4, data);
+ WriteRegister(reg_ctx, "es", nullptr, 4, data);
+ WriteRegister(reg_ctx, "fs", nullptr, 4, data);
+ WriteRegister(reg_ctx, "gs", nullptr, 4, data);
// Write out the EXC registers
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
- WriteRegister(reg_ctx, "trapno", NULL, 4, data);
- WriteRegister(reg_ctx, "err", NULL, 4, data);
- WriteRegister(reg_ctx, "faultvaddr", NULL, 4, data);
+ WriteRegister(reg_ctx, "trapno", nullptr, 4, data);
+ WriteRegister(reg_ctx, "err", nullptr, 4, data);
+ WriteRegister(reg_ctx, "faultvaddr", nullptr, 4, data);
return true;
}
return false;
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "r0", NULL, 4, data);
- WriteRegister(reg_ctx, "r1", NULL, 4, data);
- WriteRegister(reg_ctx, "r2", NULL, 4, data);
- WriteRegister(reg_ctx, "r3", NULL, 4, data);
- WriteRegister(reg_ctx, "r4", NULL, 4, data);
- WriteRegister(reg_ctx, "r5", NULL, 4, data);
- WriteRegister(reg_ctx, "r6", NULL, 4, data);
- WriteRegister(reg_ctx, "r7", NULL, 4, data);
- WriteRegister(reg_ctx, "r8", NULL, 4, data);
- WriteRegister(reg_ctx, "r9", NULL, 4, data);
- WriteRegister(reg_ctx, "r10", NULL, 4, data);
- WriteRegister(reg_ctx, "r11", NULL, 4, data);
- WriteRegister(reg_ctx, "r12", NULL, 4, data);
- WriteRegister(reg_ctx, "sp", NULL, 4, data);
- WriteRegister(reg_ctx, "lr", NULL, 4, data);
- WriteRegister(reg_ctx, "pc", NULL, 4, data);
- WriteRegister(reg_ctx, "cpsr", NULL, 4, data);
+ WriteRegister(reg_ctx, "r0", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r1", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r2", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r3", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r4", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r5", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r6", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r7", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r8", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r9", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r10", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r11", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r12", nullptr, 4, data);
+ WriteRegister(reg_ctx, "sp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "lr", nullptr, 4, data);
+ WriteRegister(reg_ctx, "pc", nullptr, 4, data);
+ WriteRegister(reg_ctx, "cpsr", nullptr, 4, data);
// Write out the EXC registers
// data.PutHex32 (EXCRegSet);
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "x0", NULL, 8, data);
- WriteRegister(reg_ctx, "x1", NULL, 8, data);
- WriteRegister(reg_ctx, "x2", NULL, 8, data);
- WriteRegister(reg_ctx, "x3", NULL, 8, data);
- WriteRegister(reg_ctx, "x4", NULL, 8, data);
- WriteRegister(reg_ctx, "x5", NULL, 8, data);
- WriteRegister(reg_ctx, "x6", NULL, 8, data);
- WriteRegister(reg_ctx, "x7", NULL, 8, data);
- WriteRegister(reg_ctx, "x8", NULL, 8, data);
- WriteRegister(reg_ctx, "x9", NULL, 8, data);
- WriteRegister(reg_ctx, "x10", NULL, 8, data);
- WriteRegister(reg_ctx, "x11", NULL, 8, data);
- WriteRegister(reg_ctx, "x12", NULL, 8, data);
- WriteRegister(reg_ctx, "x13", NULL, 8, data);
- WriteRegister(reg_ctx, "x14", NULL, 8, data);
- WriteRegister(reg_ctx, "x15", NULL, 8, data);
- WriteRegister(reg_ctx, "x16", NULL, 8, data);
- WriteRegister(reg_ctx, "x17", NULL, 8, data);
- WriteRegister(reg_ctx, "x18", NULL, 8, data);
- WriteRegister(reg_ctx, "x19", NULL, 8, data);
- WriteRegister(reg_ctx, "x20", NULL, 8, data);
- WriteRegister(reg_ctx, "x21", NULL, 8, data);
- WriteRegister(reg_ctx, "x22", NULL, 8, data);
- WriteRegister(reg_ctx, "x23", NULL, 8, data);
- WriteRegister(reg_ctx, "x24", NULL, 8, data);
- WriteRegister(reg_ctx, "x25", NULL, 8, data);
- WriteRegister(reg_ctx, "x26", NULL, 8, data);
- WriteRegister(reg_ctx, "x27", NULL, 8, data);
- WriteRegister(reg_ctx, "x28", NULL, 8, data);
- WriteRegister(reg_ctx, "fp", NULL, 8, data);
- WriteRegister(reg_ctx, "lr", NULL, 8, data);
- WriteRegister(reg_ctx, "sp", NULL, 8, data);
- WriteRegister(reg_ctx, "pc", NULL, 8, data);
- WriteRegister(reg_ctx, "cpsr", NULL, 4, data);
+ WriteRegister(reg_ctx, "x0", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x1", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x2", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x3", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x4", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x5", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x6", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x7", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x8", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x9", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x10", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x11", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x12", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x13", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x14", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x15", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x16", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x17", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x18", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x19", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x20", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x21", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x22", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x23", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x24", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x25", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x26", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x27", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x28", nullptr, 8, data);
+ WriteRegister(reg_ctx, "fp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "lr", nullptr, 8, data);
+ WriteRegister(reg_ctx, "sp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "pc", nullptr, 8, data);
+ WriteRegister(reg_ctx, "cpsr", nullptr, 4, data);
// Write out the EXC registers
// data.PutHex32 (EXCRegSet);
if (objfile_up.get() && objfile_up->ParseHeader())
return objfile_up.release();
}
- return NULL;
+ return nullptr;
}
size_t ObjectFileMachO::GetModuleSpecifications(
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> symtab_guard(
m_symtab_up->GetMutex());
const lldb::offset_t load_cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == LC_DYSYMTAB) {
m_dysymtab.cmd = lc.cmd;
m_dysymtab.cmdsize = lc.cmdsize;
if (m_data.GetU32(&offset, &m_dysymtab.ilocalsym,
(sizeof(m_dysymtab) / sizeof(uint32_t)) - 2) ==
- NULL) {
+ nullptr) {
// Clear m_dysymtab if we were unable to read all items from the
// load command
::memset(&m_dysymtab, 0, sizeof(m_dysymtab));
encryption_info_command encryption_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &encryption_cmd, 2) == nullptr)
break;
// LC_ENCRYPTION_INFO and LC_ENCRYPTION_INFO_64 have the same sizes for the
for (segment_sect_idx = 0; segment_sect_idx < load_cmd.nsects;
++segment_sect_idx) {
if (m_data.GetU8(&offset, (uint8_t *)sect64.sectname,
- sizeof(sect64.sectname)) == NULL)
+ sizeof(sect64.sectname)) == nullptr)
break;
if (m_data.GetU8(&offset, (uint8_t *)sect64.segname,
- sizeof(sect64.segname)) == NULL)
+ sizeof(sect64.segname)) == nullptr)
break;
sect64.addr = m_data.GetAddress(&offset);
sect64.size = m_data.GetAddress(&offset);
- if (m_data.GetU32(&offset, §64.offset, num_u32s) == NULL)
+ if (m_data.GetU32(&offset, §64.offset, num_u32s) == nullptr)
break;
// Keep a list of mach sections around in case we need to get at data that
bool section_is_encrypted = false;
if (!segment_is_encrypted && load_cmd.filesize != 0)
section_is_encrypted = context.EncryptedRanges.FindEntryThatContains(
- sect64.offset) != NULL;
+ sect64.offset) != nullptr;
section_sp->SetIsEncrypted(segment_is_encrypted || section_is_encrypted);
section_sp->SetPermissions(segment_permissions);
if (curr_section_sp.get()) {
if (curr_section_sp->GetByteSize() == 0) {
- if (next_section_sp.get() != NULL)
+ if (next_section_sp.get() != nullptr)
curr_section_sp->SetByteSize(next_section_sp->GetFileAddress() -
curr_section_sp->GetFileAddress());
else
struct load_command load_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_SEGMENT || load_cmd.cmd == LC_SEGMENT_64)
if (terminalSize != 0) {
TrieEntryWithOffset e(offset);
e.entry.flags = data.GetULEB128(&offset);
- const char *import_name = NULL;
+ const char *import_name = nullptr;
if (e.entry.flags & EXPORT_SYMBOL_FLAGS_REEXPORT) {
e.entry.address = 0;
e.entry.other = data.GetULEB128(&offset); // dylib ordinal
const lldb::offset_t cmd_offset = offset;
// Read in the load command and load command size
struct load_command lc;
- if (m_data.GetU32(&offset, &lc, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc, 2) == nullptr)
break;
// Watch for the symbol table load command
switch (lc.cmd) {
symtab_load_command.cmdsize = lc.cmdsize;
// Read in the rest of the symtab load command
if (m_data.GetU32(&offset, &symtab_load_command.symoff, 4) ==
- 0) // fill in symoff, nsyms, stroff, strsize fields
+ nullptr) // fill in symoff, nsyms, stroff, strsize fields
return 0;
if (symtab_load_command.symoff == 0) {
if (log)
function_starts_load_command.cmd = lc.cmd;
function_starts_load_command.cmdsize = lc.cmdsize;
if (m_data.GetU32(&offset, &function_starts_load_command.dataoff, 2) ==
- NULL) // fill in symoff, nsyms, stroff, strsize fields
+ nullptr) // fill in symoff, nsyms, stroff, strsize fields
memset(&function_starts_load_command, 0,
sizeof(function_starts_load_command));
break;
if (symtab_load_command.cmd) {
Symtab *symtab = m_symtab_up.get();
SectionList *section_list = GetSectionList();
- if (section_list == NULL)
+ if (section_list == nullptr)
return 0;
const uint32_t addr_byte_size = m_data.GetAddressByteSize();
const size_t nlist_byte_size =
bit_width_32 ? sizeof(struct nlist) : sizeof(struct nlist_64);
- DataExtractor nlist_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor strtab_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor function_starts_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor indirect_symbol_index_data(NULL, 0, byte_order,
+ DataExtractor nlist_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor strtab_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor function_starts_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor indirect_symbol_index_data(nullptr, 0, byte_order,
addr_byte_size);
- DataExtractor dyld_trie_data(NULL, 0, byte_order, addr_byte_size);
+ DataExtractor dyld_trie_data(nullptr, 0, byte_order, addr_byte_size);
const addr_t nlist_data_byte_size =
symtab_load_command.nsyms * nlist_byte_size;
// so we know
NListIndexToSymbolIndexMap m_nlist_idx_to_sym_idx;
uint32_t nlist_idx = 0;
- Symbol *symbol_ptr = NULL;
+ Symbol *symbol_ptr = nullptr;
uint32_t sym_idx = 0;
- Symbol *sym = NULL;
+ Symbol *sym = nullptr;
size_t num_syms = 0;
std::string memory_symbol_name;
uint32_t unmapped_local_symbols_found = 0;
// If the sym array was not created while parsing the DSC unmapped
// symbols, create it now.
- if (sym == NULL) {
+ if (sym == nullptr) {
sym = symtab->Resize(symtab_load_command.nsyms +
m_dysymtab.nindirectsyms);
num_syms = symtab->GetNumSymbols();
nlist.n_value = nlist_data.GetAddress_unchecked(&nlist_data_offset);
SymbolType type = eSymbolTypeInvalid;
- const char *symbol_name = NULL;
+ const char *symbol_name = nullptr;
if (have_strtab_data) {
symbol_name = strtab_data.PeekCStr(nlist.n_strx);
- if (symbol_name == NULL) {
+ if (symbol_name == nullptr) {
// No symbol should be NULL, even the symbols with no string values
// should have an offset zero which points to an empty C-string
Host::SystemLog(Host::eSystemLogError,
continue;
}
if (symbol_name[0] == '\0')
- symbol_name = NULL;
+ symbol_name = nullptr;
} else {
const addr_t str_addr = strtab_addr + nlist.n_strx;
Status str_error;
str_error))
symbol_name = memory_symbol_name.c_str();
}
- const char *symbol_name_non_abi_mangled = NULL;
+ const char *symbol_name_non_abi_mangled = nullptr;
SectionSP symbol_section;
lldb::addr_t symbol_byte_size = 0;
case N_SO:
// source file name
type = eSymbolTypeSourceFile;
- if (symbol_name == NULL) {
+ if (symbol_name == nullptr) {
add_nlist = false;
if (N_SO_index != UINT32_MAX) {
// Set the size of the N_SO to the terminating index of this
if (func_start_entry->addr != symbol_lookup_file_addr &&
func_start_entry->addr != (symbol_lookup_file_addr + 1)) {
// Not the right entry, NULL it out...
- func_start_entry = NULL;
+ func_start_entry = nullptr;
}
}
if (func_start_entry) {
NListIndexToSymbolIndexMap::const_iterator index_pos =
m_nlist_idx_to_sym_idx.find(stub_sym_id);
- Symbol *stub_symbol = NULL;
+ Symbol *stub_symbol = nullptr;
if (index_pos != end_index_pos) {
// We have a remapping from the original nlist index to a
// current symbol index, so just look this up by index
Mangled stub_symbol_mangled_name(stub_symbol->GetMangled());
if (sym_idx >= num_syms) {
sym = symtab->Resize(++num_syms);
- stub_symbol = NULL; // this pointer no longer valid
+ stub_symbol = nullptr; // this pointer no longer valid
}
sym[sym_idx].SetID(synthetic_sym_id++);
sym[sym_idx].GetMangled() = stub_symbol_mangled_name;
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
}
}
lldb::offset_t offset = lc_offset;
for (i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_UUID) {
lldb::offset_t offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
struct version_min_command version_min;
offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
do {
if (load_cmd.cmd == llvm::MachO::LC_BUILD_VERSION) {
uint32_t i;
for (i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
switch (load_cmd.cmd) {
for (i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
switch (load_cmd.cmd) {
thread_command thread_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &thread_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &thread_cmd, 2) == nullptr)
break;
if (thread_cmd.cmd == LC_THREAD) {
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
- break;
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
+ break;
if (lc.cmd == LC_NOTE)
{
char data_owner[17];
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
struct ident_command ident_command;
- if (m_data.GetU32(&offset, &ident_command, 2) == NULL)
+ if (m_data.GetU32(&offset, &ident_command, 2) == nullptr)
break;
if (ident_command.cmd == LC_IDENT && ident_command.cmdsize != 0) {
char *buf = (char *) malloc (ident_command.cmdsize);
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
- break;
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
+ break;
if (lc.cmd == LC_NOTE)
{
char data_owner[17];
uint32_t i;
for (i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_ID_DYLIB) {
if (version_cmd == 0) {
version_cmd = load_cmd.cmd;
- if (m_data.GetU32(&offset, &load_cmd.dylib, 4) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd.dylib, 4) == nullptr)
break;
version = load_cmd.dylib.current_version;
}
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX ||
lc.cmd == llvm::MachO::LC_VERSION_MIN_IPHONEOS ||
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX ||
lc.cmd == llvm::MachO::LC_VERSION_MIN_IPHONEOS ||
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_BUILD_VERSION) {
// struct build_version_command {
// the sentinel value indicating that this object file
// does not have a valid minimum os version #.
if (m_sdk_versions.size() > 1) {
- if (versions != NULL && num_versions > 0) {
+ if (versions != nullptr && num_versions > 0) {
for (size_t i = 0; i < num_versions; ++i) {
if (i < m_sdk_versions.size())
versions[i] = m_sdk_versions[i];
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
SectionList *sect_list = GetSectionList();
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> guard(m_symtab_up->GetMutex());
for (uint32_t i = 0; i < num_syms; ++i) {
coff_symbol_t symbol;
const uint32_t symbol_offset = offset;
- const char *symbol_name_cstr = NULL;
+ const char *symbol_name_cstr = nullptr;
// If the first 4 bytes of the symbol string are zero, then they
// are followed by a 4-byte string table offset. Else these
// 8 bytes contain the symbol name
// bytes
offset += sizeof(symbol.name) - 4; // Skip remaining
symbol_name_cstr = symtab_data.PeekCStr(symbol_offset);
- if (symbol_name_cstr == NULL)
+ if (symbol_name_cstr == nullptr)
break;
symbol_name.assign(symbol_name_cstr, sizeof(symbol.name));
}
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
if (m_dos_header.e_magic)
DumpDOSHeader(s, m_dos_header);
if (os_up.get() && os_up->IsValid())
return os_up.release();
}
- return NULL;
+ return nullptr;
}
ConstString OperatingSystemPython::GetPluginNameStatic() {
OperatingSystemPython::OperatingSystemPython(lldb_private::Process *process,
const FileSpec &python_module_path)
: OperatingSystem(process), m_thread_list_valobj_sp(), m_register_info_up(),
- m_interpreter(NULL), m_python_object_sp() {
+ m_interpreter(nullptr), m_python_object_sp() {
if (!process)
return;
TargetSP target_sp = process->CalculateTarget();
OperatingSystemPython::~OperatingSystemPython() {}
DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {
- if (m_register_info_up == NULL) {
+ if (m_register_info_up == nullptr) {
if (!m_interpreter || !m_python_object_sp)
- return NULL;
+ return nullptr;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));
if (log)
StructuredData::DictionarySP dictionary =
m_interpreter->OSPlugin_RegisterInfo(m_python_object_sp);
if (!dictionary)
- return NULL;
+ return nullptr;
m_register_info_up.reset(new DynamicRegisterInfo(
*dictionary, m_process->GetTarget().GetArchitecture()));
StructuredData::ObjectSP thread_dict_obj =
threads_list->GetItemAtIndex(i);
if (auto thread_dict = thread_dict_obj->GetAsDictionary()) {
- ThreadSP thread_sp(
- CreateThreadFromThreadInfo(*thread_dict, core_thread_list,
- old_thread_list, core_used_map, NULL));
+ ThreadSP thread_sp(CreateThreadFromThreadInfo(
+ *thread_dict, core_thread_list, old_thread_list, core_used_map,
+ nullptr));
if (thread_sp)
new_thread_list.AddThread(thread_sp);
}
Status &error) {
lldb::ProcessSP process_sp;
if (IsHost()) {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
ArchSpec emptyArchSpec;
// even when debugging locally we are debugging remotely! Just like the
// darwin plugin.
process_sp = target->CreateProcess(
- attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
+ attach_info.GetListenerForProcess(debugger), "gdb-remote", nullptr);
if (process_sp)
error = process_sp->Attach(attach_info);
// Figure out what shell we're planning on using.
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
// Handle the hijacking of process events.
if (listener_sp) {
const StateType state = process_sp->WaitForProcessToStop(
- llvm::None, NULL, false, listener_sp);
+ llvm::None, nullptr, false, listener_sp);
LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state);
}
new_module_spec.GetFileSpec() = bundle_directory;
if (Host::ResolveExecutableInBundle(new_module_spec.GetFileSpec())) {
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL, old_module_sp_ptr,
+ new_module_spec, process, module_sp, nullptr, old_module_sp_ptr,
did_create_ptr));
if (module_sp)
ModuleSpec new_module_spec(module_spec);
new_module_spec.GetFileSpec() = new_file_spec;
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL,
+ new_module_spec, process, module_sp, nullptr,
old_module_sp_ptr, did_create_ptr));
if (module_sp) {
std::string command_output;
Status error =
Host::RunShellCommand("/usr/bin/xcode-select --print-path",
- NULL, // current working directory
+ nullptr, // current working directory
&exit_status, &signo, &command_output,
std::chrono::seconds(2), // short timeout
false); // don't run in a shell
assert(m_developer_directory.empty() == false);
if (m_developer_directory[0])
return m_developer_directory.c_str();
- return NULL;
+ return nullptr;
}
BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint(Target &target) {
bool internal = true;
bool hardware = false;
LazyBool skip_prologue = eLazyBoolNo;
- bp_sp = target.CreateBreakpoint(&bp_modules, NULL, g_bp_names,
+ bp_sp = target.CreateBreakpoint(&bp_modules, nullptr, g_bp_names,
llvm::array_lengthof(g_bp_names),
eFunctionNameTypeFull, eLanguageTypeUnknown,
0, skip_prologue, internal, hardware);
std::string shell_string = shell.GetPath();
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
const char *command = "/usr/bin/xcode-select -p";
lldb_private::Status error = Host::RunShellCommand(
command, // shell command to run
- NULL, // current working directory
+ nullptr, // current working directory
&status, // Put the exit status of the process in here
&signo, // Put the signal that caused the process to exit in here
&output, // Get the output from the command and place it in this
ModuleSpec new_module_spec(module_spec);
new_module_spec.GetFileSpec() = path_to_try;
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL, old_module_sp_ptr,
+ new_module_spec, process, module_sp, nullptr, old_module_sp_ptr,
did_create_ptr));
if (module_sp) {
const char *command = "xcrun -sdk macosx --show-sdk-path";
lldb_private::Status error = RunShellCommand(
command, // shell command to run
- NULL, // current working directory
+ nullptr, // current working directory
&status, // Put the exit status of the process in here
&signo, // Put the signal that caused the process to exit in
// here
if (module_spec.GetArchitecture().GetCore() ==
ArchSpec::eCore_x86_64_x86_64h) {
ObjectFile *objfile = module_sp->GetObjectFile();
- if (objfile == NULL) {
+ if (objfile == nullptr) {
// We didn't find an x86_64h slice, fall back to a x86_64 slice
ModuleSpec module_spec_x86_64(module_spec);
module_spec_x86_64.GetArchitecture() = ArchSpec("x86_64-apple-macosx");
if (resolved_module_spec.GetArchitecture().IsValid() ||
resolved_module_spec.GetUUID().IsValid()) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
idx, resolved_module_spec.GetArchitecture());
++idx) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
// Did we find an executable using one of the
if (error.Success()) {
if (exe_module_sp && exe_module_sp->GetObjectFile())
return &m_sdk_directory_infos[i];
}
}
- return NULL;
+ return nullptr;
}
const PlatformRemoteDarwinDevice::SDKDirectoryInfo *
PlatformRemoteDarwinDevice::GetSDKDirectoryForLatestOSVersion() {
- const PlatformRemoteDarwinDevice::SDKDirectoryInfo *result = NULL;
+ const PlatformRemoteDarwinDevice::SDKDirectoryInfo *result = nullptr;
if (UpdateSDKDirectoryInfosIfNeeded()) {
auto max = std::max_element(
m_sdk_directory_infos.begin(), m_sdk_directory_infos.end(),
assert(m_device_support_directory.empty() == false);
if (m_device_support_directory[0])
return m_device_support_directory.c_str();
- return NULL;
+ return nullptr;
}
const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion() {
if (m_device_support_directory_for_os_version.empty()) {
const PlatformRemoteDarwinDevice::SDKDirectoryInfo *sdk_dir_info =
GetSDKDirectoryForCurrentOSVersion();
- if (sdk_dir_info == NULL)
+ if (sdk_dir_info == nullptr)
sdk_dir_info = GetSDKDirectoryForLatestOSVersion();
if (sdk_dir_info) {
char path[PATH_MAX];
assert(m_device_support_directory_for_os_version.empty() == false);
if (m_device_support_directory_for_os_version[0])
return m_device_support_directory_for_os_version.c_str();
- return NULL;
+ return nullptr;
}
uint32_t PlatformRemoteDarwinDevice::FindFileInAllSDKs(const char *platform_file_path,
if (GetFileInSDK(platform_file_path, connected_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
m_last_module_sdk_idx = connected_sdk_idx;
error.Clear();
if (GetFileInSDK(platform_file_path, m_last_module_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
error.Clear();
return error;
if (GetFileInSDK(platform_file_path, current_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
m_last_module_sdk_idx = current_sdk_idx;
error.Clear();
platform_module_spec.GetFileSpec())) {
// printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
// Remember the index of the last SDK that we found a file in in case
// the wrong SDK was selected.
uint32_t PlatformRemoteDarwinDevice::GetSDKIndexBySDKDirectoryInfo(
const SDKDirectoryInfo *sdk_info) {
- if (sdk_info == NULL) {
+ if (sdk_info == nullptr) {
return UINT32_MAX;
}
// Figure out what shell we're planning on using.
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
// Handle the hijacking of process events.
if (listener_sp) {
const StateType state = process_sp->WaitForProcessToStop(
- llvm::None, NULL, false, listener_sp);
+ llvm::None, nullptr, false, listener_sp);
LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state);
}
command.Printf(":%d", gid);
command.Printf("%s", path);
int status;
- platform->RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
- std::chrono::seconds(10));
+ platform->RunShellCommand(command.GetData(), nullptr, &status, nullptr,
+ nullptr, std::chrono::seconds(10));
return status;
}
StreamString command;
command.Printf("cp %s %s", src_path.c_str(), dst_path.c_str());
int status;
- RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
+ RunShellCommand(command.GetData(), nullptr, &status, nullptr, nullptr,
std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
if (log)
log->Printf("[PutFile] Running command: %s\n", command.GetData());
int retcode;
- Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
- std::chrono::minutes(1));
+ Host::RunShellCommand(command.GetData(), nullptr, &retcode, nullptr,
+ nullptr, std::chrono::minutes(1));
if (retcode == 0) {
// Don't chown a local file for a remote system
// if (chown_file(this,dst_path.c_str(),uid,gid) != 0)
StreamString cp_command;
cp_command.Printf("cp %s %s", src_path.c_str(), dst_path.c_str());
int status;
- RunShellCommand(cp_command.GetData(), NULL, &status, NULL, NULL,
+ RunShellCommand(cp_command.GetData(), nullptr, &status, nullptr, nullptr,
std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
if (log)
log->Printf("[GetFile] Running command: %s\n", command.GetData());
int retcode;
- Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
- std::chrono::minutes(1));
+ Host::RunShellCommand(command.GetData(), nullptr, &retcode, nullptr,
+ nullptr, std::chrono::minutes(1));
if (retcode == 0)
return Status();
// If we are here, rsync has failed - let's try the slow way before
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM));
if (IsHost()) {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
if (log)
log->Printf("PlatformPOSIX::%s created new target", __FUNCTION__);
process_sp =
target->CreateProcess(attach_info.GetListenerForProcess(debugger),
- attach_info.GetProcessPluginName(), NULL);
+ attach_info.GetProcessPluginName(), nullptr);
if (process_sp) {
ListenerSP listener_sp = attach_info.GetHijackListener();
if (resolved_module_spec.GetArchitecture().IsValid() ||
resolved_module_spec.GetUUID().IsValid()) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- module_search_paths_ptr, NULL, NULL);
+ module_search_paths_ptr, nullptr,
+ nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
idx, resolved_module_spec.GetArchitecture());
++idx) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- module_search_paths_ptr, NULL, NULL);
+ module_search_paths_ptr, nullptr,
+ nullptr);
// Did we find an executable using one of the
if (error.Success()) {
if (exe_module_sp && exe_module_sp->GetObjectFile())
const char *PlatformRemoteGDBServer::GetHostname() {
m_gdb_client.GetHostname(m_name);
if (m_name.empty())
- return NULL;
+ return nullptr;
return m_name.c_str();
}
error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'",
GetHostname());
} else {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
} else
error.Clear();
// The darwin always currently uses the GDB remote debugger plug-in
// so even when debugging locally we are debugging remotely!
process_sp = target->CreateProcess(launch_info.GetListener(),
- "gdb-remote", NULL);
+ "gdb-remote", nullptr);
if (process_sp) {
error = process_sp->ConnectRemote(nullptr, connect_url.c_str());
error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'",
GetHostname());
} else {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
} else
error.Clear();
// The darwin always currently uses the GDB remote debugger plug-in
// so even when debugging locally we are debugging remotely!
- process_sp = target->CreateProcess(
- attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
+ process_sp =
+ target->CreateProcess(attach_info.GetListenerForProcess(debugger),
+ "gdb-remote", nullptr);
if (process_sp) {
error = process_sp->ConnectRemote(nullptr, connect_url.c_str());
if (error.Success()) {
unsigned int *__eax, unsigned int *__ebx,
unsigned int *__ecx, unsigned int *__edx)
{
- unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
+ unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, nullptr);
- if (__max_leaf == 0 || __max_leaf < __leaf)
- return 0;
+ if (__max_leaf == 0 || __max_leaf < __leaf)
+ return 0;
- __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
- return 1;
+ __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
}
using namespace lldb_private;
errno = 0;
auto base =
- mmap(NULL, (metabufsize + page_size), PROT_WRITE, MAP_SHARED, fd, 0);
+ mmap(nullptr, (metabufsize + page_size), PROT_WRITE, MAP_SHARED, fd, 0);
if (base == MAP_FAILED) {
LLDB_LOG(log, "mmap base error {0}", errno);
m_mmap_meta->aux_size = bufsize;
errno = 0;
- auto mmap_aux = mmap(NULL, bufsize, PROT_READ, MAP_SHARED, fd,
+ auto mmap_aux = mmap(nullptr, bufsize, PROT_READ, MAP_SHARED, fd,
static_cast<long int>(m_mmap_meta->aux_offset));
if (mmap_aux == MAP_FAILED) {
chcar str[8];
sprintf(str, "%d", reason);
#else
- const char *str = NULL;
+ const char *str = nullptr;
switch (kind) {
case eInvalidMessage:
for (uint32_t i = 0; i < num_sets; ++i) {
ConstString set_name;
if (sets->GetItemAtIndexAsString(i, set_name) && !set_name.IsEmpty()) {
- m_sets.push_back({ set_name.AsCString(), NULL, 0, NULL });
+ m_sets.push_back({set_name.AsCString(), nullptr, 0, nullptr});
} else {
Clear();
printf("error: register sets must have valid names\n");
llvm::StringRef format_str;
if (reg_info_dict->GetValueForKeyAsString("format", format_str, nullptr)) {
if (OptionArgParser::ToFormat(format_str.str().c_str(), reg_info.format,
- NULL)
+ nullptr)
.Fail()) {
Clear();
printf("error: invalid 'format' value in register dictionary\n");
const uint32_t reg_num = m_regs.size();
reg_info.name = reg_name.AsCString();
assert(reg_info.name);
- reg_info.alt_name = reg_alt_name.AsCString(NULL);
+ reg_info.alt_name = reg_alt_name.AsCString(nullptr);
uint32_t i;
if (reg_info.value_regs) {
for (i = 0; reg_info.value_regs[i] != LLDB_INVALID_REGNUM; ++i)
if (m_value_regs_map.find(i) != m_value_regs_map.end())
m_regs[i].value_regs = m_value_regs_map[i].data();
else
- m_regs[i].value_regs = NULL;
+ m_regs[i].value_regs = nullptr;
}
// Expand all invalidation dependencies
if (m_invalidate_regs_map.find(i) != m_invalidate_regs_map.end())
m_regs[i].invalidate_regs = m_invalidate_regs_map[i].data();
else
- m_regs[i].invalidate_regs = NULL;
+ m_regs[i].invalidate_regs = nullptr;
}
// Check if we need to automatically set the generic registers in case they
DynamicRegisterInfo::GetRegisterInfoAtIndex(uint32_t i) const {
if (i < m_regs.size())
return &m_regs[i];
- return NULL;
+ return nullptr;
}
RegisterInfo *DynamicRegisterInfo::GetRegisterInfoAtIndex(uint32_t i) {
if (i < m_regs.size())
return &m_regs[i];
- return NULL;
+ return nullptr;
}
const RegisterSet *DynamicRegisterInfo::GetRegisterSet(uint32_t i) const {
if (i < m_sets.size())
return &m_sets[i];
- return NULL;
+ return nullptr;
}
uint32_t DynamicRegisterInfo::GetRegisterSetIndexByName(ConstString &set_name,
m_set_names.push_back(set_name);
m_set_reg_nums.resize(m_set_reg_nums.size() + 1);
- RegisterSet new_set = {set_name.AsCString(), NULL, 0, NULL};
+ RegisterSet new_set = {set_name.AsCString(), nullptr, 0, nullptr};
m_sets.push_back(new_set);
return m_sets.size() - 1;
}
return ®_info;
}
}
- return NULL;
+ return nullptr;
}
// FIXME do not throw away the lock after we acquire it..
std::unique_lock<std::mutex> lock(m_framelist_mutex);
lock.unlock();
- if (m_framelist.get() == NULL) {
+ if (m_framelist.get() == nullptr) {
m_framelist =
std::make_shared<StackFrameList>(*this, StackFrameListSP(), true);
}
unsigned flags, addr_t fd, addr_t offset) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL)
+ if (thread == nullptr)
return false;
const bool append = true;
addr_t length) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL)
+ if (thread == nullptr)
return false;
const bool append = true;
addr_t &returned_func, bool trap_exceptions) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL || address == NULL)
+ if (thread == nullptr || address == nullptr)
return false;
EvaluateExpressionOptions options;
// =============== =============== =========================
// ===================== =============
{"r0",
- NULL,
+ nullptr,
4,
GPR_OFFSET(0),
eEncodingUint,
nullptr,
0},
{"r1",
- NULL,
+ nullptr,
4,
GPR_OFFSET(1),
eEncodingUint,
nullptr,
0},
{"r2",
- NULL,
+ nullptr,
4,
GPR_OFFSET(2),
eEncodingUint,
nullptr,
0},
{"r3",
- NULL,
+ nullptr,
4,
GPR_OFFSET(3),
eEncodingUint,
nullptr,
0},
{"r4",
- NULL,
+ nullptr,
4,
GPR_OFFSET(4),
eEncodingUint,
nullptr,
0},
{"r5",
- NULL,
+ nullptr,
4,
GPR_OFFSET(5),
eEncodingUint,
nullptr,
0},
{"r6",
- NULL,
+ nullptr,
4,
GPR_OFFSET(6),
eEncodingUint,
nullptr,
0},
{"r7",
- NULL,
+ nullptr,
4,
GPR_OFFSET(7),
eEncodingUint,
nullptr,
0},
{"r8",
- NULL,
+ nullptr,
4,
GPR_OFFSET(8),
eEncodingUint,
nullptr,
0},
{"r9",
- NULL,
+ nullptr,
4,
GPR_OFFSET(9),
eEncodingUint,
nullptr,
0},
{"r10",
- NULL,
+ nullptr,
4,
GPR_OFFSET(10),
eEncodingUint,
nullptr,
0},
{"r11",
- NULL,
+ nullptr,
4,
GPR_OFFSET(11),
eEncodingUint,
nullptr,
0},
{"r12",
- NULL,
+ nullptr,
4,
GPR_OFFSET(12),
eEncodingUint,
0},
{"s0",
- NULL,
+ nullptr,
4,
FPU_OFFSET(0),
eEncodingIEEE754,
nullptr,
0},
{"s1",
- NULL,
+ nullptr,
4,
FPU_OFFSET(1),
eEncodingIEEE754,
nullptr,
0},
{"s2",
- NULL,
+ nullptr,
4,
FPU_OFFSET(2),
eEncodingIEEE754,
nullptr,
0},
{"s3",
- NULL,
+ nullptr,
4,
FPU_OFFSET(3),
eEncodingIEEE754,
nullptr,
0},
{"s4",
- NULL,
+ nullptr,
4,
FPU_OFFSET(4),
eEncodingIEEE754,
nullptr,
0},
{"s5",
- NULL,
+ nullptr,
4,
FPU_OFFSET(5),
eEncodingIEEE754,
nullptr,
0},
{"s6",
- NULL,
+ nullptr,
4,
FPU_OFFSET(6),
eEncodingIEEE754,
nullptr,
0},
{"s7",
- NULL,
+ nullptr,
4,
FPU_OFFSET(7),
eEncodingIEEE754,
nullptr,
0},
{"s8",
- NULL,
+ nullptr,
4,
FPU_OFFSET(8),
eEncodingIEEE754,
nullptr,
0},
{"s9",
- NULL,
+ nullptr,
4,
FPU_OFFSET(9),
eEncodingIEEE754,
nullptr,
0},
{"s10",
- NULL,
+ nullptr,
4,
FPU_OFFSET(10),
eEncodingIEEE754,
nullptr,
0},
{"s11",
- NULL,
+ nullptr,
4,
FPU_OFFSET(11),
eEncodingIEEE754,
nullptr,
0},
{"s12",
- NULL,
+ nullptr,
4,
FPU_OFFSET(12),
eEncodingIEEE754,
nullptr,
0},
{"s13",
- NULL,
+ nullptr,
4,
FPU_OFFSET(13),
eEncodingIEEE754,
nullptr,
0},
{"s14",
- NULL,
+ nullptr,
4,
FPU_OFFSET(14),
eEncodingIEEE754,
nullptr,
0},
{"s15",
- NULL,
+ nullptr,
4,
FPU_OFFSET(15),
eEncodingIEEE754,
nullptr,
0},
{"s16",
- NULL,
+ nullptr,
4,
FPU_OFFSET(16),
eEncodingIEEE754,
nullptr,
0},
{"s17",
- NULL,
+ nullptr,
4,
FPU_OFFSET(17),
eEncodingIEEE754,
nullptr,
0},
{"s18",
- NULL,
+ nullptr,
4,
FPU_OFFSET(18),
eEncodingIEEE754,
nullptr,
0},
{"s19",
- NULL,
+ nullptr,
4,
FPU_OFFSET(19),
eEncodingIEEE754,
nullptr,
0},
{"s20",
- NULL,
+ nullptr,
4,
FPU_OFFSET(20),
eEncodingIEEE754,
nullptr,
0},
{"s21",
- NULL,
+ nullptr,
4,
FPU_OFFSET(21),
eEncodingIEEE754,
nullptr,
0},
{"s22",
- NULL,
+ nullptr,
4,
FPU_OFFSET(22),
eEncodingIEEE754,
nullptr,
0},
{"s23",
- NULL,
+ nullptr,
4,
FPU_OFFSET(23),
eEncodingIEEE754,
nullptr,
0},
{"s24",
- NULL,
+ nullptr,
4,
FPU_OFFSET(24),
eEncodingIEEE754,
nullptr,
0},
{"s25",
- NULL,
+ nullptr,
4,
FPU_OFFSET(25),
eEncodingIEEE754,
nullptr,
0},
{"s26",
- NULL,
+ nullptr,
4,
FPU_OFFSET(26),
eEncodingIEEE754,
nullptr,
0},
{"s27",
- NULL,
+ nullptr,
4,
FPU_OFFSET(27),
eEncodingIEEE754,
nullptr,
0},
{"s28",
- NULL,
+ nullptr,
4,
FPU_OFFSET(28),
eEncodingIEEE754,
nullptr,
0},
{"s29",
- NULL,
+ nullptr,
4,
FPU_OFFSET(29),
eEncodingIEEE754,
nullptr,
0},
{"s30",
- NULL,
+ nullptr,
4,
FPU_OFFSET(30),
eEncodingIEEE754,
nullptr,
0},
{"s31",
- NULL,
+ nullptr,
4,
FPU_OFFSET(31),
eEncodingIEEE754,
nullptr,
0},
{"fpscr",
- NULL,
+ nullptr,
4,
FPU_OFFSET(32),
eEncodingUint,
0},
{"exception",
- NULL,
+ nullptr,
4,
EXC_OFFSET(0),
eEncodingUint,
nullptr,
0},
{"fsr",
- NULL,
+ nullptr,
4,
EXC_OFFSET(1),
eEncodingUint,
nullptr,
0},
{"far",
- NULL,
+ nullptr,
4,
EXC_OFFSET(2),
eEncodingUint,
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_arm::GetRegisterInfosCount() {
const RegisterSet *RegisterContextDarwin_arm::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for 32 bit i386.
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos_arm64_le[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_arm64::GetRegisterInfosCount() {
const RegisterSet *RegisterContextDarwin_arm64::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for arm64
// =============================== =======================
// =================== ========================= ==================
// =================
- {DEFINE_GPR(eax, NULL),
+ {DEFINE_GPR(eax, nullptr),
{ehframe_eax, dwarf_eax, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_eax},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ebx, NULL),
+ {DEFINE_GPR(ebx, nullptr),
{ehframe_ebx, dwarf_ebx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_ebx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ecx, NULL),
+ {DEFINE_GPR(ecx, nullptr),
{ehframe_ecx, dwarf_ecx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_ecx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(edx, NULL),
+ {DEFINE_GPR(edx, nullptr),
{ehframe_edx, dwarf_edx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_edx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(edi, NULL),
+ {DEFINE_GPR(edi, nullptr),
{ehframe_edi, dwarf_edi, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_edi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(esi, NULL),
+ {DEFINE_GPR(esi, nullptr),
{ehframe_esi, dwarf_esi, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_esi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ss, NULL),
+ {DEFINE_GPR(ss, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_ss},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(cs, NULL),
+ {DEFINE_GPR(cs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_cs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ds, NULL),
+ {DEFINE_GPR(ds, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_ds},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(es, NULL),
+ {DEFINE_GPR(es, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_es},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(fs, NULL),
+ {DEFINE_GPR(fs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_fs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(gs, NULL),
+ {DEFINE_GPR(gs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_gs},
nullptr,
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_i386::GetRegisterInfosCount() {
const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for 32 bit i386.
// =============================== ======================
// =================== ========================== ====================
// ===================
- {DEFINE_GPR(rax, NULL),
+ {DEFINE_GPR(rax, nullptr),
{ehframe_dwarf_gpr_rax, ehframe_dwarf_gpr_rax, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rax},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rbx, NULL),
+ {DEFINE_GPR(rbx, nullptr),
{ehframe_dwarf_gpr_rbx, ehframe_dwarf_gpr_rbx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rbx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rcx, NULL),
+ {DEFINE_GPR(rcx, nullptr),
{ehframe_dwarf_gpr_rcx, ehframe_dwarf_gpr_rcx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rcx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rdx, NULL),
+ {DEFINE_GPR(rdx, nullptr),
{ehframe_dwarf_gpr_rdx, ehframe_dwarf_gpr_rdx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rdx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rdi, NULL),
+ {DEFINE_GPR(rdi, nullptr),
{ehframe_dwarf_gpr_rdi, ehframe_dwarf_gpr_rdi, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rdi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rsi, NULL),
+ {DEFINE_GPR(rsi, nullptr),
{ehframe_dwarf_gpr_rsi, ehframe_dwarf_gpr_rsi, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rsi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r8, NULL),
+ {DEFINE_GPR(r8, nullptr),
{ehframe_dwarf_gpr_r8, ehframe_dwarf_gpr_r8, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r8},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r9, NULL),
+ {DEFINE_GPR(r9, nullptr),
{ehframe_dwarf_gpr_r9, ehframe_dwarf_gpr_r9, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r9},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r10, NULL),
+ {DEFINE_GPR(r10, nullptr),
{ehframe_dwarf_gpr_r10, ehframe_dwarf_gpr_r10, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r10},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r11, NULL),
+ {DEFINE_GPR(r11, nullptr),
{ehframe_dwarf_gpr_r11, ehframe_dwarf_gpr_r11, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r11},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r12, NULL),
+ {DEFINE_GPR(r12, nullptr),
{ehframe_dwarf_gpr_r12, ehframe_dwarf_gpr_r12, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r12},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r13, NULL),
+ {DEFINE_GPR(r13, nullptr),
{ehframe_dwarf_gpr_r13, ehframe_dwarf_gpr_r13, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r13},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r14, NULL),
+ {DEFINE_GPR(r14, nullptr),
{ehframe_dwarf_gpr_r14, ehframe_dwarf_gpr_r14, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r14},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r15, NULL),
+ {DEFINE_GPR(r15, nullptr),
{ehframe_dwarf_gpr_r15, ehframe_dwarf_gpr_r15, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r15},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(cs, NULL),
+ {DEFINE_GPR(cs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_cs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(fs, NULL),
+ {DEFINE_GPR(fs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_fs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(gs, NULL),
+ {DEFINE_GPR(gs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_gs},
nullptr,
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_x86_64::GetRegisterInfosCount() {
RegisterContextDarwin_x86_64::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
int RegisterContextDarwin_x86_64::GetSetForNativeRegNum(int reg_num) {
m_pc_reg_info.byte_size = address_byte_size;
m_pc_reg_info.encoding = eEncodingUint;
m_pc_reg_info.format = eFormatPointer;
- m_pc_reg_info.invalidate_regs = NULL;
- m_pc_reg_info.value_regs = NULL;
+ m_pc_reg_info.invalidate_regs = nullptr;
+ m_pc_reg_info.value_regs = nullptr;
m_pc_reg_info.kinds[eRegisterKindEHFrame] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindDWARF] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_PC;
const lldb_private::RegisterInfo *
RegisterContextDummy::GetRegisterInfoAtIndex(size_t reg) {
if (reg)
- return NULL;
+ return nullptr;
return &m_pc_reg_info;
}
const lldb_private::RegisterSet *
RegisterContextDummy::GetRegisterSet(size_t reg_set) {
if (reg_set)
- return NULL;
+ return nullptr;
return &m_reg_set0;
}
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
const RegisterInfo *RegisterContextFreeBSD_powerpc::GetRegisterInfo() const {
// assert (m_target_arch.GetCore() == ArchSpec::eCore_powerpc);
llvm_unreachable("Abstract class!");
- return NULL;
+ return nullptr;
}
uint32_t RegisterContextFreeBSD_powerpc::GetRegisterCount() const { return 0; }
m_pc_reg_info.byte_size = address_byte_size;
m_pc_reg_info.encoding = eEncodingUint;
m_pc_reg_info.format = eFormatPointer;
- m_pc_reg_info.invalidate_regs = NULL;
- m_pc_reg_info.value_regs = NULL;
+ m_pc_reg_info.invalidate_regs = nullptr;
+ m_pc_reg_info.value_regs = nullptr;
m_pc_reg_info.kinds[eRegisterKindEHFrame] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindDWARF] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_PC;
const lldb_private::RegisterInfo *
RegisterContextHistory::GetRegisterInfoAtIndex(size_t reg) {
if (reg)
- return NULL;
+ return nullptr;
return &m_pc_reg_info;
}
const lldb_private::RegisterSet *
RegisterContextHistory::GetRegisterSet(size_t reg_set) {
if (reg_set)
- return NULL;
+ return nullptr;
return &m_reg_set0;
}
ExecutionContext exe_ctx(m_thread.shared_from_this());
RegisterContextSP reg_ctx_sp = m_thread.GetRegisterContext();
- if (reg_ctx_sp.get() == NULL) {
+ if (reg_ctx_sp.get() == nullptr) {
m_frame_type = eNotAValidFrame;
UnwindLogMsg("frame does not have a register context");
return;
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp ||
- pc_module_sp->GetObjectFile() == NULL)
+ pc_module_sp->GetObjectFile() == nullptr)
return unwind_plan_sp;
if (IsFrameZero())
UnwindPlanSP arch_default_unwind_plan_sp;
ExecutionContext exe_ctx(m_thread.shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
- ABI *abi = process ? process->GetABI().get() : NULL;
+ ABI *abi = process ? process->GetABI().get() : nullptr;
if (abi) {
arch_default_unwind_plan_sp =
std::make_shared<UnwindPlan>(lldb::eRegisterKindGeneric);
// This is for jumping to memory regions without any information available.
if ((!m_sym_ctx_valid ||
- (m_sym_ctx.function == NULL && m_sym_ctx.symbol == NULL)) &&
+ (m_sym_ctx.function == nullptr && m_sym_ctx.symbol == nullptr)) &&
behaves_like_zeroth_frame && m_current_pc.IsValid()) {
uint32_t permissions;
addr_t current_pc_addr =
// No Module for the current pc, try using the architecture default unwind.
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp ||
- pc_module_sp->GetObjectFile() == NULL) {
+ pc_module_sp->GetObjectFile() == nullptr) {
m_frame_type = eNormalFrame;
return arch_default_unwind_plan_sp;
}
// register, we may be able to fall back to some ABI-defined default. For
// example, some ABIs allow to determine the caller's SP via the CFA. Also,
// the ABI may set volatile registers to the undefined state.
- ABI *abi = process ? process->GetABI().get() : NULL;
+ ABI *abi = process ? process->GetABI().get() : nullptr;
if (abi) {
const RegisterInfo *reg_info =
GetRegisterInfoAtIndex(regnum.GetAsKind(eRegisterKindLLDB));
}
bool RegisterContextLLDB::ForceSwitchToFallbackUnwindPlan() {
- if (m_fallback_unwind_plan_sp.get() == NULL)
+ if (m_fallback_unwind_plan_sp.get() == nullptr)
return false;
- if (m_full_unwind_plan_sp.get() == NULL)
+ if (m_full_unwind_plan_sp.get() == nullptr)
return false;
if (m_full_unwind_plan_sp.get() == m_fallback_unwind_plan_sp.get() ||
va_start(args, fmt);
char *logmsg;
- if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == NULL) {
+ if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == nullptr) {
if (logmsg)
free(logmsg);
va_end(args);
va_start(args, fmt);
char *logmsg;
- if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == NULL) {
+ if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == nullptr) {
if (logmsg)
free(logmsg);
va_end(args);
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {
RegisterInfo orig_ax = {"orig_eax",
- NULL,
- sizeof(((GPR *)NULL)->orig_eax),
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_eax),
(LLVM_EXTENSION offsetof(GPR, orig_eax)),
eEncodingUint,
eFormatHex,
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
return g_register_infos_mips;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_user_register_count(GetUserRegisterInfoCount(target_arch)) {
RegisterInfo orig_ax = {"orig_rax",
- NULL,
- sizeof(((GPR *)NULL)->orig_rax),
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_rax),
(LLVM_EXTENSION offsetof(GPR, orig_rax)),
eEncodingUint,
eFormatHex,
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_arm::GetRegisterSetCount() {
return &g_reg_sets_arm[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_arm::GetRegisterName(unsigned reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_arm64::GetRegisterSetCount() {
return &g_reg_sets_arm64[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_arm64::GetRegisterName(unsigned reg) {
if (reg < m_num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_mips64::GetRegisterSetCount() {
if (reg < k_num_registers_powerpc)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_powerpc::GetRegisterSetCount() {
if (IsRegisterSetAvailable(set))
return &g_reg_sets_powerpc[set];
else
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_powerpc::GetRegisterName(unsigned reg) {
if (reg < k_num_registers_ppc64le)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_ppc64le::GetRegisterSetCount() {
if (IsRegisterSetAvailable(set))
return &g_reg_sets_ppc64le[set];
else
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_ppc64le::GetRegisterName(unsigned reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_s390x::GetRegisterCount() {
return &g_reg_sets_s390x[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
lldb::ByteOrder RegisterContextPOSIX_s390x::GetByteOrder() {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_x86::GetRegisterSetCount() {
return &g_reg_sets_x86_64[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_x86::GetRegisterName(unsigned reg) {
UpdateRegisterContext();
if (m_reg_ctx_sp)
return m_reg_ctx_sp->GetRegisterInfoAtIndex(reg);
- return NULL;
+ return nullptr;
}
size_t RegisterContextThreadMemory::GetRegisterSetCount() {
UpdateRegisterContext();
if (m_reg_ctx_sp)
return m_reg_ctx_sp->GetRegisterSet(reg_set);
- return NULL;
+ return nullptr;
}
bool RegisterContextThreadMemory::ReadRegister(const RegisterInfo *reg_info,
return g_register_infos_arm;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
return g_register_infos_arm64_le;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
return g_register_infos_ppc64le;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
target ? target->GetArchitecture().GetMachine()
: llvm::Triple::UnknownArch;
- const char *exc_desc = NULL;
+ const char *exc_desc = nullptr;
const char *code_label = "code";
- const char *code_desc = NULL;
+ const char *code_desc = nullptr;
const char *subcode_label = "subcode";
- const char *subcode_desc = NULL;
+ const char *subcode_desc = nullptr;
#if defined(__APPLE__)
char code_desc_buf[32];
// the thread ID so we must always report the breakpoint regardless
// of the thread.
if (bp_site_sp->ValidForThisThread(&thread) ||
- thread.GetProcess()->GetOperatingSystem() != NULL)
+ thread.GetProcess()->GetOperatingSystem() != nullptr)
return StopInfo::CreateStopReasonWithBreakpointSiteID(
thread, bp_site_sp->GetID());
else if (is_trace_if_actual_breakpoint_missing)
return 0;
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (AddOneMoreFrame(abi)) {
#if DEBUG_FRAME_SPEED
return true;
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
// First, set up the 0th (initial) frame
CursorSP first_cursor_sp(new Cursor());
RegisterContextLLDBSP reg_ctx_sp(new RegisterContextLLDB(
m_thread, RegisterContextLLDBSP(), first_cursor_sp->sctx, 0, *this));
- if (reg_ctx_sp.get() == NULL)
+ if (reg_ctx_sp.get() == nullptr)
goto unwind_done;
if (!reg_ctx_sp->IsValid())
return nullptr;
}
- if (reg_ctx_sp.get() == NULL) {
+ if (reg_ctx_sp.get() == nullptr) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
// that and return true. Subsequent calls to TryFallbackUnwindPlan() will
// return false.
}
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (idx >= m_frames.size() && AddOneMoreFrame(abi))
;
}
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (idx >= m_frames.size()) {
if (!AddOneMoreFrame(abi))
StackFrame *first_frame = exe_ctx.GetFramePtr();
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return 0;
struct Frame_i386 {
SymbolContext first_frame_sc(
first_frame->GetSymbolContext(resolve_scope));
- const AddressRange *addr_range_ptr = NULL;
+ const AddressRange *addr_range_ptr = nullptr;
AddressRange range;
if (first_frame_sc.function)
addr_range_ptr = &first_frame_sc.function->GetAddressRange();
m_cursors.clear();
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return 0;
StackFrame *first_frame = exe_ctx.GetFramePtr();
SymbolContext first_frame_sc(
first_frame->GetSymbolContext(resolve_scope));
- const AddressRange *addr_range_ptr = NULL;
+ const AddressRange *addr_range_ptr = nullptr;
AddressRange range;
if (first_frame_sc.function)
addr_range_ptr = &first_frame_sc.function->GetAddressRange();
if (!m_core_module_sp && FileSystem::Instance().Exists(m_core_file)) {
ModuleSpec core_module_spec(m_core_file, target_sp->GetArchitecture());
Status error(ModuleList::GetSharedModule(core_module_spec, m_core_module_sp,
- NULL, NULL, NULL));
+ nullptr, nullptr, nullptr));
if (m_core_module_sp) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
if (core_objfile && core_objfile->GetType() == ObjectFile::eTypeCoreFile)
}
ObjectFileELF *core = (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
- if (core == NULL) {
+ if (core == nullptr) {
error.SetErrorString("invalid core object file");
return error;
}
}
lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
+ if (m_dyld_up.get() == nullptr)
m_dyld_up.reset(DynamicLoader::FindPlugin(
this, DynamicLoaderPOSIXDYLD::GetPluginNameStatic().GetCString()));
return m_dyld_up.get();
Status &error) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
- if (core_objfile == NULL)
+ if (core_objfile == nullptr)
return 0;
// Get the address range
const VMRangeToFileOffset::Entry *address_range =
m_core_aranges.FindEntryThatContains(addr);
- if (address_range == NULL || address_range->GetRangeEnd() < addr) {
+ if (address_range == nullptr || address_range->GetRangeEnd() < addr) {
error.SetErrorStringWithFormat("core file does not contain 0x%" PRIx64,
addr);
return 0;
const char *GetName() override {
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
void GDBRemoteClientBase::OnRunPacketSent(bool first) {
if (first)
- BroadcastEvent(eBroadcastBitRunPacketSent, NULL);
+ BroadcastEvent(eBroadcastBitRunPacketSent, nullptr);
}
///////////////////////////////////////
// packet. Let's interrupt it.
const char ctrl_c = '\x03';
ConnectionStatus status = eConnectionStatusSuccess;
- size_t bytes_written = m_comm.Write(&ctrl_c, 1, status, NULL);
+ size_t bytes_written = m_comm.Write(&ctrl_c, 1, status, nullptr);
if (bytes_written == 0) {
--m_comm.m_async_count;
if (log)
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '+';
- const size_t bytes_written = Write(&ch, 1, status, NULL);
+ const size_t bytes_written = Write(&ch, 1, status, nullptr);
if (log)
log->Printf("<%4" PRIu64 "> send packet: %c", (uint64_t)bytes_written, ch);
m_history.AddPacket(ch, GDBRemoteCommunicationHistory::ePacketTypeSend,
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '-';
- const size_t bytes_written = Write(&ch, 1, status, NULL);
+ const size_t bytes_written = Write(&ch, 1, status, nullptr);
if (log)
log->Printf("<%4" PRIu64 "> send packet: %c", (uint64_t)bytes_written, ch);
m_history.AddPacket(ch, GDBRemoteCommunicationHistory::ePacketTypeSend,
ConnectionStatus status = eConnectionStatusSuccess;
const char *packet_data = packet.data();
const size_t packet_length = packet.size();
- size_t bytes_written = Write(packet_data, packet_length, status, NULL);
+ size_t bytes_written = Write(packet_data, packet_length, status, nullptr);
if (log) {
size_t binary_start_offset = 0;
if (strncmp(packet_data, "$vFile:pwrite:", strlen("$vFile:pwrite:")) ==
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
// Check for a packet from our cache first without trying any reading...
- if (CheckForPacket(NULL, 0, packet) != PacketType::Invalid)
+ if (CheckForPacket(nullptr, 0, packet) != PacketType::Invalid)
return PacketResult::Success;
bool timed_out = false;
content_length = hash_mark_idx - content_start;
std::string bufsize_str(m_bytes.data() + 2, i - 2 - 1);
errno = 0;
- decompressed_bufsize = ::strtoul(bufsize_str.c_str(), NULL, 10);
+ decompressed_bufsize = ::strtoul(bufsize_str.c_str(), nullptr, 10);
if (errno != 0 || decompressed_bufsize == ULONG_MAX) {
m_bytes.erase(0, size_of_first_packet);
return false;
packet_checksum_cstr[0] = m_bytes[checksum_idx];
packet_checksum_cstr[1] = m_bytes[checksum_idx + 1];
packet_checksum_cstr[2] = '\0';
- long packet_checksum = strtol(packet_checksum_cstr, NULL, 16);
+ long packet_checksum = strtol(packet_checksum_cstr, nullptr, 16);
long actual_checksum = CalculcateChecksum(
llvm::StringRef(m_bytes).substr(1, hash_mark_idx - 1));
::isxdigit(m_bytes[checksum_idx + 1])) {
if (GetSendAcks()) {
const char *packet_checksum_cstr = &m_bytes[checksum_idx];
- char packet_checksum = strtol(packet_checksum_cstr, NULL, 16);
+ char packet_checksum = strtol(packet_checksum_cstr, nullptr, 16);
char actual_checksum = CalculcateChecksum(
llvm::StringRef(m_bytes).slice(content_start, content_end));
success = packet_checksum == actual_checksum;
// Do the listen on another thread so we can continue on...
if (connection->Connect(comm->m_listen_url.c_str(), &error) !=
eConnectionStatusSuccess)
- comm->SetConnection(NULL);
+ comm->SetConnection(nullptr);
}
- return NULL;
+ return nullptr;
}
Status GDBRemoteCommunication::StartDebugserverProcess(
std::vector<std::string> supported_compressions;
compressions += sizeof("SupportedCompressions=") - 1;
const char *end_of_compressions = strchr(compressions, ';');
- if (end_of_compressions == NULL) {
+ if (end_of_compressions == nullptr) {
end_of_compressions = strchr(compressions, '\0');
}
const char *current_compression = compressions;
while (current_compression < end_of_compressions) {
const char *next_compression_name = strchr(current_compression, ',');
const char *end_of_this_word = next_compression_name;
- if (next_compression_name == NULL ||
+ if (next_compression_name == nullptr ||
end_of_compressions < next_compression_name) {
end_of_this_word = end_of_compressions;
}
std::vector<const char *> argv;
FileSpec exe_file = launch_info.GetExecutableFile();
std::string exe_path;
- const char *arg = NULL;
+ const char *arg = nullptr;
const Args &launch_args = launch_info.GetArguments();
if (exe_file)
exe_path = exe_file.GetPath(false);
}
if (!exe_path.empty()) {
argv.push_back(exe_path.c_str());
- for (uint32_t i = 1; (arg = launch_args.GetArgumentAtIndex(i)) != NULL;
+ for (uint32_t i = 1; (arg = launch_args.GetArgumentAtIndex(i)) != nullptr;
++i) {
if (arg)
argv.push_back(arg);
if (!m_gdb_server_name.empty())
return m_gdb_server_name.c_str();
}
- return NULL;
+ return nullptr;
}
uint32_t GDBRemoteCommunicationClient::GetGDBServerProgramVersion() {
bool GDBRemoteRegisterContext::PrivateSetRegisterValue(
uint32_t reg, llvm::ArrayRef<uint8_t> data) {
const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
return false;
// Invalidate if needed
bool GDBRemoteRegisterContext::PrivateSetRegisterValue(uint32_t reg,
uint64_t new_reg_val) {
const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
return false;
// Early in process startup, we can get a thread that has an invalid byte
uint8_t *dst = const_cast<uint8_t *>(
m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size));
- if (dst == NULL)
+ if (dst == nullptr)
return false;
if (data.CopyByteOrderedData(0, // src offset
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
// We have a valid primordial register as our constituent. Grab the
// corresponding register info.
const RegisterInfo *prim_reg_info = GetRegisterInfoAtIndex(prim_reg);
- if (prim_reg_info == NULL)
+ if (prim_reg_info == nullptr)
success = false;
else {
// Read the containing register if it hasn't already been read
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
uint8_t *dst = const_cast<uint8_t *>(
m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size));
- if (dst == NULL)
+ if (dst == nullptr)
return false;
if (data.CopyByteOrderedData(data_offset, // src offset
// We have a valid primordial register as our constituent. Grab the
// corresponding register info.
const RegisterInfo *value_reg_info = GetRegisterInfoAtIndex(reg);
- if (value_reg_info == NULL)
+ if (value_reg_info == nullptr)
success = false;
else
success = SetPrimordialRegister(value_reg_info, gdb_comm);
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
// individually and store them as binary data in a buffer.
const RegisterInfo *reg_info;
- for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != NULL; i++) {
+ for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != nullptr;
+ i++) {
if (reg_info
->value_regs) // skip registers that are slices of real registers
continue;
bool GDBRemoteRegisterContext::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
- if (!data_sp || data_sp->GetBytes() == NULL || data_sp->GetByteSize() == 0)
+ if (!data_sp || data_sp->GetBytes() == nullptr || data_sp->GetByteSize() == 0)
return false;
ExecutionContext exe_ctx(CalculateThread());
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
uint64_t size_by_highest_offset = 0;
for (uint32_t reg_idx = 0;
- (reg_info = GetRegisterInfoAtIndex(reg_idx)) != NULL; ++reg_idx) {
+ (reg_info = GetRegisterInfoAtIndex(reg_idx)) != nullptr; ++reg_idx) {
size_including_slice_registers += reg_info->byte_size;
- if (reg_info->value_regs == NULL)
+ if (reg_info->value_regs == nullptr)
size_not_including_slice_registers += reg_info->byte_size;
if (reg_info->byte_offset >= size_by_highest_offset)
size_by_highest_offset = reg_info->byte_offset + reg_info->byte_size;
// keep track of the size of each reg & compute offset based on that.
uint32_t running_byte_offset = 0;
for (uint32_t reg_idx = 0;
- (reg_info = GetRegisterInfoAtIndex(reg_idx)) != NULL;
+ (reg_info = GetRegisterInfoAtIndex(reg_idx)) != nullptr;
++reg_idx, running_byte_offset += reg_info->byte_size) {
// Skip composite aka slice registers (e.g. eax is a slice of rax).
if (reg_info->value_regs)
}
uint32_t num_restored = 0;
const RegisterInfo *reg_info;
- for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != NULL;
+ for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != nullptr;
i++) {
if (reg_info->value_regs) // skip registers that are slices of real
// registers
{"packet-timeout", OptionValue::eTypeUInt64, true, 5
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
- * 2
+ * 2
#endif
#endif
- , NULL, {},
+ , nullptr, {},
"Specify the default packet timeout in seconds."},
- {"target-definition-file", OptionValue::eTypeFileSpec, true, 0, NULL, {},
+ {"target-definition-file", OptionValue::eTypeFileSpec, true, 0, nullptr, {},
"The file that provides the description for remote target registers."}};
enum { ePropertyPacketTimeout, ePropertyTargetDefinitionFile };
uint64_t GetPacketTimeout() {
const uint32_t idx = ePropertyPacketTimeout;
return m_collection_sp->GetPropertyAtIndexAsUInt64(
- NULL, idx, g_properties[idx].default_uint_value);
+ nullptr, idx, g_properties[idx].default_uint_value);
}
bool SetPacketTimeout(uint64_t timeout) {
const uint32_t idx = ePropertyPacketTimeout;
- return m_collection_sp->SetPropertyAtIndexAsUInt64(NULL, idx, timeout);
+ return m_collection_sp->SetPropertyAtIndexAsUInt64(nullptr, idx, timeout);
}
FileSpec GetTargetDefinitionFile() const {
const uint32_t idx = ePropertyTargetDefinitionFile;
- return m_collection_sp->GetPropertyAtIndexAsFileSpec(NULL, idx);
+ return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx);
}
};
ListenerSP listener_sp,
const FileSpec *crash_file_path) {
lldb::ProcessSP process_sp;
- if (crash_file_path == NULL)
+ if (crash_file_path == nullptr)
process_sp = std::make_shared<ProcessGDBRemote>(target_sp, listener_sp);
return process_sp;
}
: Process(target_sp, listener_sp),
m_debugserver_pid(LLDB_INVALID_PROCESS_ID), m_last_stop_packet_mutex(),
m_register_info(),
- m_async_broadcaster(NULL, "lldb.process.gdb-remote.async-broadcaster"),
+ m_async_broadcaster(nullptr, "lldb.process.gdb-remote.async-broadcaster"),
m_async_listener_sp(
Listener::MakeListener("lldb.process.gdb-remote.async-listener")),
m_async_thread_state_mutex(), m_thread_ids(), m_thread_pcs(),
std::vector<uint32_t> invalidate_regs;
std::vector<uint8_t> dwarf_opcode_bytes;
RegisterInfo reg_info = {
- NULL, // Name
- NULL, // Alt name
+ nullptr, // Name
+ nullptr, // Alt name
0, // byte size
reg_offset, // offset
eEncodingUint, // encoding
reg_num, // process plugin reg num
reg_num // native register number
},
- NULL,
- NULL,
- NULL, // Dwarf expression opcode bytes pointer
- 0 // Dwarf expression opcode bytes length
+ nullptr,
+ nullptr,
+ nullptr, // Dwarf expression opcode bytes pointer
+ 0 // Dwarf expression opcode bytes length
};
while (response.GetNameColonValue(name, value)) {
reg_info.encoding = encoding;
} else if (name.equals("format")) {
Format format = eFormatInvalid;
- if (OptionArgParser::ToFormat(value.str().c_str(), format, NULL)
+ if (OptionArgParser::ToFormat(value.str().c_str(), format, nullptr)
.Success())
reg_info.format = format;
else {
// since 'O' packets can really slow down debugging if the inferior
// does a lot of output.
if ((!stdin_file_spec || !stdout_file_spec || !stderr_file_spec) &&
- pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY, NULL, 0)) {
- FileSpec slave_name{pty.GetSlaveName(NULL, 0)};
+ pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY, nullptr, 0)) {
+ FileSpec slave_name{pty.GetSlaveName(nullptr, 0)};
if (!stdin_file_spec)
stdin_file_spec = slave_name;
GetTarget().GetArchitecture().GetArchitectureName());
const char *launch_event_data = launch_info.GetLaunchEventData();
- if (launch_event_data != NULL && *launch_event_data != '\0')
+ if (launch_event_data != nullptr && *launch_event_data != '\0')
m_gdb_comm.SendLaunchEventDataPacket(launch_event_data);
if (working_dir) {
gdb_thread->PrivateSetRegisterValue(pair.first, buffer_sp->GetData());
}
- thread_sp->SetName(thread_name.empty() ? NULL : thread_name.c_str());
+ thread_sp->SetName(thread_name.empty() ? nullptr : thread_name.c_str());
gdb_thread->SetThreadDispatchQAddr(thread_dispatch_qaddr);
// Check if the GDB server was able to provide the queue name, kind and
Status &error) {
if (m_stdio_communication.IsConnected()) {
ConnectionStatus status;
- m_stdio_communication.Write(src, src_len, status, NULL);
+ m_stdio_communication.Write(src, src_len, status, nullptr);
} else if (m_stdin_forward) {
m_gdb_comm.SendStdinNotification(src, src_len);
}
Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
Status error;
- assert(bp_site != NULL);
+ assert(bp_site != nullptr);
// Get logging info
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
Status ProcessGDBRemote::DisableBreakpointSite(BreakpointSite *bp_site) {
Status error;
- assert(bp_site != NULL);
+ assert(bp_site != nullptr);
addr_t addr = bp_site->GetLoadAddress();
user_id_t site_id = bp_site->GetID();
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
// Create a thread that watches our internal state and controls which
// events make it to clients (into the DCProcess event queue).
- m_async_thread =
- ThreadLauncher::LaunchThread("<lldb.process.gdb-remote.async>",
- ProcessGDBRemote::AsyncThread, this, NULL);
+ m_async_thread = ThreadLauncher::LaunchThread(
+ "<lldb.process.gdb-remote.async>", ProcessGDBRemote::AsyncThread, this,
+ nullptr);
} else if (log)
log->Printf("ProcessGDBRemote::%s () - Called when Async thread was "
"already running.",
") got eBroadcastBitAsyncContinue: %s",
__FUNCTION__, arg, process->GetID(), continue_cstr);
- if (::strstr(continue_cstr, "vAttach") == NULL)
+ if (::strstr(continue_cstr, "vAttach") == nullptr)
process->SetPrivateState(eStateRunning);
StringExtractorGDBRemote response;
// the "E87" error code from debugserver -- this indicates that
// the process is not debuggable. Return a slightly more
// helpful error message about why the attach failed.
- if (::strstr(continue_cstr, "vAttach") != NULL &&
+ if (::strstr(continue_cstr, "vAttach") != nullptr &&
response.GetError() == 0x87) {
process->SetExitStatus(-1, "cannot attach to process due to "
"System Integrity Protection");
- } else if (::strstr(continue_cstr, "vAttach") != NULL &&
+ } else if (::strstr(continue_cstr, "vAttach") != nullptr &&
response.GetStatus().Fail()) {
process->SetExitStatus(-1, response.GetStatus().AsCString());
} else {
") thread exiting...",
__FUNCTION__, arg, process->GetID());
- return NULL;
+ return nullptr;
}
// uint32_t
}
}
}
- return m_thread_create_bp_sp.get() != NULL;
+ return m_thread_create_bp_sp.get() != nullptr;
}
bool ProcessGDBRemote::StopNoticingNewThreads() {
}
DynamicLoader *ProcessGDBRemote::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
- m_dyld_up.reset(DynamicLoader::FindPlugin(this, NULL));
+ if (m_dyld_up.get() == nullptr)
+ m_dyld_up.reset(DynamicLoader::FindPlugin(this, nullptr));
return m_dyld_up.get();
}
bool encoding_set = false;
bool format_set = false;
RegisterInfo reg_info = {
- NULL, // Name
- NULL, // Alt name
+ nullptr, // Name
+ nullptr, // Alt name
0, // byte size
reg_offset, // offset
eEncodingUint, // encoding
cur_reg_num, // process plugin reg num
cur_reg_num // native register number
},
- NULL,
- NULL,
- NULL, // Dwarf Expression opcode bytes pointer
- 0 // Dwarf Expression opcode bytes length
+ nullptr,
+ nullptr,
+ nullptr, // Dwarf Expression opcode bytes pointer
+ 0 // Dwarf Expression opcode bytes length
};
reg_node.ForEachAttribute([&target_info, &gdb_group, &gdb_type,
} else if (name == "format") {
format_set = true;
Format format = eFormatInvalid;
- if (OptionArgParser::ToFormat(value.data(), format, NULL).Success())
+ if (OptionArgParser::ToFormat(value.data(), format, nullptr)
+ .Success())
reg_info.format = format;
else if (value == "vector-sint8")
reg_info.format = eFormatVectorOfSInt8;
"Tests packet speeds of various sizes to determine "
"the performance characteristics of the GDB remote "
"connection. ",
- NULL),
+ nullptr),
m_option_group(),
m_num_packets(LLDB_OPT_SET_1, false, "count", 'c', 0, eArgTypeCount,
"The number of packets to send of each varying size "
public:
CommandObjectProcessGDBRemotePacketHistory(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "process plugin packet history",
- "Dumps the packet history buffer. ", NULL) {}
+ "Dumps the packet history buffer. ", nullptr) {}
~CommandObjectProcessGDBRemotePacketHistory() override {}
: CommandObjectParsed(
interpreter, "process plugin packet xfer-size",
"Maximum size that lldb will try to read/write one one chunk.",
- NULL) {}
+ nullptr) {}
~CommandObjectProcessGDBRemotePacketXferSize() override {}
if (process) {
const char *packet_size = command.GetArgumentAtIndex(0);
errno = 0;
- uint64_t user_specified_max = strtoul(packet_size, NULL, 10);
+ uint64_t user_specified_max = strtoul(packet_size, nullptr, 10);
if (errno == 0 && user_specified_max != 0) {
process->SetUserSpecifiedMaxMemoryTransferSize(user_specified_max);
result.SetStatus(eReturnStatusSuccessFinishResult);
"The packet header and footer will automatically "
"be added to the packet prior to sending and "
"stripped from the result.",
- NULL) {}
+ nullptr) {}
~CommandObjectProcessGDBRemotePacketSend() override {}
output_strm.Printf(" packet: %s\n", packet_cstr);
std::string &response_str = response.GetStringRef();
- if (strstr(packet_cstr, "qGetProfileData") != NULL) {
+ if (strstr(packet_cstr, "qGetProfileData") != nullptr) {
response_str = process->HarmonizeThreadIdsForProfileData(response);
}
CommandObjectProcessGDBRemotePacket(CommandInterpreter &interpreter)
: CommandObjectMultiword(interpreter, "process plugin packet",
"Commands that deal with GDB remote packets.",
- NULL) {
+ nullptr) {
LoadSubCommand(
"history",
CommandObjectSP(
// ModuleSpecList::FindMatchingModuleSpec enforces a strict arch mach.
ModuleSpec core_module_spec(m_core_file);
Status error(ModuleList::GetSharedModule(core_module_spec, m_core_module_sp,
- NULL, NULL, NULL));
+ nullptr, nullptr, nullptr));
if (m_core_module_sp) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
}
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
- if (core_objfile == NULL) {
+ if (core_objfile == nullptr) {
error.SetErrorString("invalid core object file");
return error;
}
}
SectionList *section_list = core_objfile->GetSectionList();
- if (section_list == NULL) {
+ if (section_list == nullptr) {
error.SetErrorString("core file has no sections");
return error;
}
size_t p = corefile_identifier.find("stext=") + strlen("stext=");
if (corefile_identifier[p] == '0' && corefile_identifier[p + 1] == 'x') {
errno = 0;
- addr = ::strtoul(corefile_identifier.c_str() + p, NULL, 16);
+ addr = ::strtoul(corefile_identifier.c_str() + p, nullptr, 16);
if (errno != 0 || addr == 0)
addr = LLDB_INVALID_ADDRESS;
}
}
lldb_private::DynamicLoader *ProcessMachCore::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
+ if (m_dyld_up.get() == nullptr)
m_dyld_up.reset(DynamicLoader::FindPlugin(
- this,
- m_dyld_plugin_name.IsEmpty() ? NULL : m_dyld_plugin_name.GetCString()));
+ this, m_dyld_plugin_name.IsEmpty() ? nullptr
+ : m_dyld_plugin_name.GetCString()));
return m_dyld_up.get();
}
return DumpFacebook() || m_fb_logcat.GetOptionValue().GetCurrentValue();
}
public:
-
CommandObjectProcessMinidumpDump(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "process plugin dump",
- "Dump information from the minidump file.", NULL),
+ "Dump information from the minidump file.", nullptr),
m_option_group(),
INIT_BOOL(m_dump_all, "all", 'a',
"Dump the everything in the minidump."),
Locker py_lock(this,
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
should_step = LLDBSWIGPythonCallThreadPlan(
- generic->GetValue(), "should_step", NULL, script_error);
+ generic->GetValue(), "should_step", nullptr, script_error);
if (script_error)
should_step = true;
}
SymbolFileDWARF *dwarf = die.GetDWARF();
TypeSP type_sp(new Type(
die.GetID(), dwarf, dwo_type_sp->GetName(), dwo_type_sp->GetByteSize(),
- NULL, LLDB_INVALID_UID, Type::eEncodingInvalid,
+ nullptr, LLDB_INVALID_UID, Type::eEncodingInvalid,
&dwo_type_sp->GetDeclaration(), type, Type::eResolveStateForward));
dwarf->GetTypeList()->Insert(type_sp);
sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus);
if (translation_unit_is_objc) {
- if (type_name_cstr != NULL) {
+ if (type_name_cstr != nullptr) {
static ConstString g_objc_type_name_id("id");
static ConstString g_objc_type_name_Class("Class");
static ConstString g_objc_type_name_selector("SEL");
m_property_setter_name(property_setter_name),
m_property_getter_name(property_getter_name),
m_property_attributes(property_attributes) {
- if (metadata != NULL) {
+ if (metadata != nullptr) {
m_metadata_up.reset(new ClangASTMetadata());
*m_metadata_up = *metadata;
}
DWARFAttributes attributes;
const size_t num_child_attributes = die.GetAttributes(attributes);
if (num_child_attributes > 0) {
- const char *name = NULL;
+ const char *name = nullptr;
bool got_value = false;
int64_t enum_value = 0;
Declaration decl;
Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
const DWARFDIE &die) {
DWARFRangeList func_ranges;
- const char *name = NULL;
- const char *mangled = NULL;
+ const char *name = nullptr;
+ const char *mangled = nullptr;
int decl_file = 0;
int decl_line = 0;
int decl_column = 0;
const dw_tag_t tag = die.Tag();
if (tag != DW_TAG_subprogram)
- return NULL;
+ return nullptr;
if (die.GetDIENamesAndRanges(name, mangled, func_ranges, decl_file, decl_line,
decl_column, call_file, call_line, call_column,
// Supply the type _only_ if it has already been parsed
Type *func_type = dwarf->GetDIEToType().lookup(die.GetDIE());
- assert(func_type == NULL || func_type != DIE_IS_BEING_PARSED);
+ assert(func_type == nullptr || func_type != DIE_IS_BEING_PARSED);
if (dwarf->FixupAddress(func_range.GetBaseAddress())) {
const user_id_t func_user_id = die.GetID();
func_user_id, func_name, func_type,
func_range); // first address range
- if (func_sp.get() != NULL) {
+ if (func_sp.get() != nullptr) {
if (frame_base.IsValid())
func_sp->GetFrameBaseExpression() = frame_base;
comp_unit.AddFunction(func_sp);
}
}
}
- return NULL;
+ return nullptr;
}
bool DWARFASTParserClang::ParseChildMembers(
if (num_attributes > 0) {
Declaration decl;
// DWARFExpression location;
- const char *name = NULL;
- const char *prop_name = NULL;
- const char *prop_getter_name = NULL;
- const char *prop_setter_name = NULL;
+ const char *name = nullptr;
+ const char *prop_name = nullptr;
+ const char *prop_getter_name = nullptr;
+ const char *prop_setter_name = nullptr;
uint32_t prop_attributes = 0;
bool is_artificial = false;
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue,
nullptr, memberOffset, nullptr)) {
- member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
+ member_byte_offset =
+ memberOffset.ResolveValue(nullptr).UInt();
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
if (!is_artificial) {
Type *member_type = die.ResolveTypeUID(DIERef(encoding_form));
- clang::FieldDecl *field_decl = NULL;
+ clang::FieldDecl *field_decl = nullptr;
if (tag == DW_TAG_member) {
if (member_type) {
if (accessibility == eAccessNone)
}
}
- if (prop_name != NULL && member_type) {
- clang::ObjCIvarDecl *ivar_decl = NULL;
+ if (prop_name != nullptr && member_type) {
+ clang::ObjCIvarDecl *ivar_decl = nullptr;
if (field_decl) {
ivar_decl = clang::dyn_cast<clang::ObjCIvarDecl>(field_decl);
- assert(ivar_decl != NULL);
+ assert(ivar_decl != nullptr);
}
ClangASTMetadata metadata;
block_offset, block_length,
eRegisterKindDWARF, &initialValue,
nullptr, memberOffset, nullptr)) {
- member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
+ member_byte_offset =
+ memberOffset.ResolveValue(nullptr).UInt();
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
}
Type *base_class_type = die.ResolveTypeUID(DIERef(encoding_form));
- if (base_class_type == NULL) {
+ if (base_class_type == nullptr) {
module_sp->ReportError("0x%8.8x: DW_TAG_inheritance failed to "
"resolve the base class at 0x%8.8x"
" from enclosing type 0x%8.8x. \nPlease file "
DWARFAttributes attributes;
const size_t num_attributes = die.GetAttributes(attributes);
if (num_attributes > 0) {
- const char *name = NULL;
+ const char *name = nullptr;
Declaration decl;
DWARFFormValue param_type_die_form;
bool is_artificial = false;
// Often times compilers omit the "this" name for the
// specification DIEs, so we can't rely upon the name being in
// the formal parameter DIE...
- (name == NULL || ::strcmp(name, "this") == 0)) {
+ (name == nullptr || ::strcmp(name, "this") == 0)) {
Type *this_type = die.ResolveTypeUID(DIERef(param_type_die_form));
if (this_type) {
uint32_t encoding_mask = this_type->GetEncodingMask();
if (idx < m_decls.size())
return &m_decls[idx];
}
- return NULL;
+ return nullptr;
}
if (pos != m_abbrevCollMap.end())
return &(pos->second);
- return NULL;
+ return nullptr;
}
// DWARFDebugAbbrev::GetUnsupportedForms()
}
void DWARFDebugAranges::Dump(Log *log) const {
- if (log == NULL)
+ if (log == nullptr)
return;
const size_t num_entries = m_aranges.GetSize();
// Constructor
DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context)
- : m_dwarf2Data(NULL), m_context(context), m_units(), m_cu_aranges_up() {}
+ : m_dwarf2Data(nullptr), m_context(context), m_units(), m_cu_aranges_up() {}
// SetDwarfData
void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) {
}
DWARFUnit *DWARFDebugInfo::GetUnitAtIndex(user_id_t idx) {
- DWARFUnit *cu = NULL;
+ DWARFUnit *cu = nullptr;
if (idx < GetNumUnits())
cu = m_units[idx].get();
return cu;
size_t GetNumUnits();
DWARFUnit *GetUnitAtIndex(lldb::user_id_t idx);
- DWARFUnit *GetUnitAtOffset(DIERef::Section section,
- dw_offset_t cu_offset, uint32_t *idx_ptr = NULL);
+ DWARFUnit *GetUnitAtOffset(DIERef::Section section, dw_offset_t cu_offset,
+ uint32_t *idx_ptr = nullptr);
DWARFUnit *GetUnitContainingDIEOffset(DIERef::Section section,
dw_offset_t die_offset);
DWARFUnit *GetUnit(const DIERef &die_ref);
const DWARFAbbreviationDeclaration *abbrevDecl =
cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx);
- if (abbrevDecl == NULL) {
+ if (abbrevDecl == nullptr) {
cu->GetSymbolFileDWARF()->GetObjectFile()->GetModule()->ReportError(
"{0x%8.8x}: invalid abbreviation code %u, please file a bug and "
"attach the file at the start of this error message",
} break;
case DW_AT_name:
- if (name == NULL)
+ if (name == nullptr)
name = form_value.AsCString();
break;
case DW_AT_MIPS_linkage_name:
case DW_AT_linkage_name:
- if (mangled == NULL)
+ if (mangled == nullptr)
mangled = form_value.AsCString();
break;
frame_base->SetLocationListSlide(lowest_range_pc - cu->GetBaseAddress());
}
- if (ranges.IsEmpty() || name == NULL || mangled == NULL) {
+ if (ranges.IsEmpty() || name == nullptr || mangled == nullptr) {
for (const DIERef &die_ref : die_refs) {
if (die_ref.die_offset != DW_INVALID_OFFSET) {
DWARFDIE die = dwarf2Data->GetDIE(die_ref);
storage.append(name);
}
if (storage.empty())
- return NULL;
+ return nullptr;
return storage.c_str();
}
switch (m_tag) {
case DW_TAG_compile_unit: // File
case DW_TAG_partial_unit: // File
- check_children = ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ ((function_die != nullptr) || (block_die != nullptr));
break;
case DW_TAG_subprogram: // Function
if (function_die)
*function_die = this;
- check_children = (block_die != NULL);
+ check_children = (block_die != nullptr);
break;
case DW_TAG_inlined_subroutine: // Inlined Function
// Compile units may not have a valid high/low pc when there
// are address gaps in subroutines so we must always search
// if there is no valid high and low PC.
- check_children = (m_tag == DW_TAG_compile_unit ||
- m_tag == DW_TAG_partial_unit) &&
- ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ (m_tag == DW_TAG_compile_unit || m_tag == DW_TAG_partial_unit) &&
+ ((function_die != nullptr) || (block_die != nullptr));
}
} else {
DWARFFormValue form_value;
switch (m_tag) {
case DW_TAG_compile_unit: // File
case DW_TAG_partial_unit: // File
- check_children = ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ ((function_die != nullptr) || (block_die != nullptr));
break;
case DW_TAG_subprogram: // Function
if (function_die)
*function_die = this;
- check_children = (block_die != NULL);
+ check_children = (block_die != nullptr);
break;
case DW_TAG_inlined_subroutine: // Inlined Function
}
}
offset = DW_INVALID_OFFSET;
- return NULL;
+ return nullptr;
}
bool DWARFDebugInfoEntry::OffsetLessThan(const DWARFDebugInfoEntry &a,
lldb::offset_t *offset_ptr, lldb_private::Stream &s,
dw_attr_t attr, DWARFFormValue &form_value);
- bool
- GetDIENamesAndRanges(const DWARFUnit *cu, const char *&name,
- const char *&mangled, DWARFRangeList &rangeList,
- int &decl_file, int &decl_line, int &decl_column,
- int &call_file, int &call_line, int &call_column,
- lldb_private::DWARFExpression *frame_base = NULL) const;
+ bool GetDIENamesAndRanges(
+ const DWARFUnit *cu, const char *&name, const char *&mangled,
+ DWARFRangeList &rangeList, int &decl_file, int &decl_line,
+ int &decl_column, int &call_file, int &call_line, int &call_column,
+ lldb_private::DWARFExpression *frame_base = nullptr) const;
const DWARFAbbreviationDeclaration *
GetAbbreviationDeclarationPtr(const DWARFUnit *cu,
// We know we are kept in a vector of contiguous entries, so we know
// our parent will be some index behind "this".
DWARFDebugInfoEntry *GetParent() {
- return m_parent_idx > 0 ? this - m_parent_idx : NULL;
+ return m_parent_idx > 0 ? this - m_parent_idx : nullptr;
}
const DWARFDebugInfoEntry *GetParent() const {
- return m_parent_idx > 0 ? this - m_parent_idx : NULL;
+ return m_parent_idx > 0 ? this - m_parent_idx : nullptr;
}
// We know we are kept in a vector of contiguous entries, so we know
// our sibling will be some index after "this".
DWARFDebugInfoEntry *GetSibling() {
- return m_sibling_idx > 0 ? this + m_sibling_idx : NULL;
+ return m_sibling_idx > 0 ? this + m_sibling_idx : nullptr;
}
const DWARFDebugInfoEntry *GetSibling() const {
- return m_sibling_idx > 0 ? this + m_sibling_idx : NULL;
+ return m_sibling_idx > 0 ? this + m_sibling_idx : nullptr;
}
// We know we are kept in a vector of contiguous entries, so we know
// we don't need to store our child pointer, if we have a child it will
// be the next entry in the list...
DWARFDebugInfoEntry *GetFirstChild() {
- return HasChildren() ? this + 1 : NULL;
+ return HasChildren() ? this + 1 : nullptr;
}
const DWARFDebugInfoEntry *GetFirstChild() const {
- return HasChildren() ? this + 1 : NULL;
+ return HasChildren() ? this + 1 : nullptr;
}
std::vector<DWARFDIE> GetDeclContextDIEs(DWARFUnit *cu) const;
while (debug_line_data.ValidOffset(offset)) {
const lldb::offset_t debug_line_offset = offset;
- if (line_table_sp.get() == NULL)
+ if (line_table_sp.get() == nullptr)
break;
if (ParseStatementTable(debug_line_data, &offset, line_table_sp.get(), nullptr)) {
dw_addr_t begin_addr = begin + base_addr;
dw_addr_t end_addr = end + base_addr;
- s.AddressRange(begin_addr, end_addr, sizeof(dw_addr_t), NULL);
+ s.AddressRange(begin_addr, end_addr, sizeof(dw_addr_t), nullptr);
}
}
}
for (pos = begin; pos != end; ++pos) {
if (pos != begin)
m_qualified_name.append("::");
- if (pos->name == NULL) {
+ if (pos->name == nullptr) {
if (pos->tag == DW_TAG_namespace)
m_qualified_name.append("(anonymous namespace)");
else if (pos->tag == DW_TAG_class_type)
}
}
if (m_qualified_name.empty())
- return NULL;
+ return nullptr;
return m_qualified_name.c_str();
}
class DWARFDeclContext {
public:
struct Entry {
- Entry() : tag(0), name(NULL) {}
+ Entry() : tag(0), name(nullptr) {}
Entry(dw_tag_t t, const char *n) : tag(t), name(n) {}
bool NameMatches(const Entry &rhs) const {
bool indirect = false;
bool is_block = false;
- m_value.data = NULL;
+ m_value.data = nullptr;
uint8_t ref_addr_size;
// Read the value for the form into value and follow and DW_FORM_indirect
// instances we run into
if (is_block) {
m_value.data = data.PeekData(*offset_ptr, m_value.value.uval);
- if (m_value.data != NULL) {
+ if (m_value.data != nullptr) {
*offset_ptr += m_value.value.uval;
}
}
return 0;
else if (a_string && b_string)
return strcmp(a_string, b_string);
- else if (a_string == NULL)
+ else if (a_string == nullptr)
return -1; // A string is NULL, and B is valid
else
return 1; // A string valid, and B is NULL
class DWARFFormValue {
public:
typedef struct ValueTypeTag {
- ValueTypeTag() : value(), data(NULL) { value.uval = 0; }
+ ValueTypeTag() : value(), data(nullptr) { value.uval = 0; }
union {
uint64_t uval;
if (die) {
const char *producer_cstr =
- die->GetAttributeValueAsString(this, DW_AT_producer, NULL);
+ die->GetAttributeValueAsString(this, DW_AT_producer, nullptr);
if (producer_cstr) {
RegularExpression llvm_gcc_regex(
llvm::StringRef("^4\\.[012]\\.[01] \\(Based on Apple "
return;
llvm::StringRef comp_dir = removeHostnameFromPathname(
- die->GetAttributeValueAsString(this, DW_AT_comp_dir, NULL));
+ die->GetAttributeValueAsString(this, DW_AT_comp_dir, nullptr));
if (!comp_dir.empty()) {
FileSpec::Style comp_dir_style =
FileSpec::GuessPathStyle(comp_dir).getValueOr(FileSpec::Style::native);
} else {
// Try to detect the style based on the DW_AT_name attribute, but just store
// the detected style in the m_comp_dir field.
- const char *name = die->GetAttributeValueAsString(this, DW_AT_name, NULL);
+ const char *name =
+ die->GetAttributeValueAsString(this, DW_AT_name, nullptr);
m_comp_dir = FileSpec(
"", FileSpec::GuessPathStyle(name).getValueOr(FileSpec::Style::native));
}
dw_offset_t DWARFUnit::GetBaseObjOffset() const { return m_base_obj_offset; }
const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() {
- if (m_func_aranges_up == NULL) {
+ if (m_func_aranges_up == nullptr) {
m_func_aranges_up.reset(new DWARFDebugAranges());
const DWARFDebugInfoEntry *die = DIEPtr();
if (die)
return false;
for (size_t i = 0; i < num_atoms; ++i) {
- DWARFFormValue form_value(NULL, header_data.atoms[i].form);
+ DWARFFormValue form_value(nullptr, header_data.atoms[i].form);
if (!form_value.ExtractValue(data, offset_ptr))
return false;
// There definitely should be a string for this string offset, if there
// isn't, there is something wrong, return and error
const char *strp_cstr = m_string_table.PeekCStr(pair.key);
- if (strp_cstr == NULL) {
+ if (strp_cstr == nullptr) {
*hash_data_offset_ptr = UINT32_MAX;
return eResultError;
}
// There definitely should be a string for this string offset, if there
// isn't, there is something wrong, return and error
const char *strp_cstr = m_string_table.PeekCStr(pair.key);
- if (strp_cstr == NULL)
+ if (strp_cstr == nullptr)
return eResultError;
const uint32_t count = m_data.GetU32(hash_data_offset_ptr);
}
DWARFAttributes attributes;
- const char *name = NULL;
- const char *mangled_cstr = NULL;
+ const char *name = nullptr;
+ const char *mangled_cstr = nullptr;
bool is_declaration = false;
// bool is_artificial = false;
bool has_address = false;
has_location_or_const_value = true;
if (tag == DW_TAG_variable) {
const DWARFDebugInfoEntry *parent_die = die.GetParent();
- while (parent_die != NULL) {
+ while (parent_die != nullptr) {
switch (parent_die->Tag()) {
case DW_TAG_subprogram:
case DW_TAG_lexical_block:
// }
// }
// }
- parent_die = NULL; // Terminate the while loop.
+ parent_die = nullptr; // Terminate the while loop.
break;
case DW_TAG_compile_unit:
case DW_TAG_partial_unit:
is_global_or_static_variable = true;
- parent_die = NULL; // Terminate the while loop.
+ parent_die = nullptr; // Terminate the while loop.
break;
default:
ASSERT_MODULE_LOCK(this);
TypeSet type_set;
- CompileUnit *comp_unit = NULL;
- DWARFUnit *dwarf_cu = NULL;
+ CompileUnit *comp_unit = nullptr;
+ DWARFUnit *dwarf_cu = nullptr;
if (sc_scope)
comp_unit = sc_scope->CalculateSymbolContextCompileUnit();
if (comp_unit) {
dwarf_cu = GetDWARFCompileUnit(comp_unit);
- if (dwarf_cu == 0)
+ if (dwarf_cu == nullptr)
return 0;
GetTypes(dwarf_cu->DIE(), dwarf_cu->GetOffset(),
dwarf_cu->GetNextUnitOffset(), type_mask, type_set);
UserID(0x7fffffff00000000), // Used by SymbolFileDWARFDebugMap to
// when this class parses .o files to
// contain the .o file index/ID
- m_debug_map_module_wp(), m_debug_map_symfile(NULL),
+ m_debug_map_module_wp(), m_debug_map_symfile(nullptr),
m_context(objfile->GetModule()->GetSectionList(), dwo_section_list),
m_data_debug_loc(), m_data_debug_ranges(), m_data_debug_rnglists(),
m_abbr(), m_info(), m_line(), m_fetched_external_modules(false),
uint32_t SymbolFileDWARF::CalculateAbilities() {
uint32_t abilities = 0;
- if (m_obj_file != NULL) {
- const Section *section = NULL;
+ if (m_obj_file != nullptr) {
+ const Section *section = nullptr;
const SectionList *section_list = m_obj_file->GetSectionList();
- if (section_list == NULL)
+ if (section_list == nullptr)
return 0;
uint64_t debug_abbrev_file_size = 0;
section =
section_list->FindSectionByType(eSectionTypeDWARFDebugInfo, true).get();
- if (section != NULL) {
+ if (section != nullptr) {
debug_info_file_size = section->GetFileSize();
section =
}
DWARFDebugInfo *SymbolFileDWARF::DebugInfo() {
- if (m_info == NULL) {
+ if (m_info == nullptr) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
if (info) {
// The compile unit ID is the index of the DWARF unit.
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID());
- if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
+ if (dwarf_cu && dwarf_cu->GetUserData() == nullptr)
dwarf_cu->SetUserData(comp_unit);
return dwarf_cu;
}
- return NULL;
+ return nullptr;
}
DWARFDebugRangesBase *SymbolFileDWARF::DebugRanges() {
- if (m_ranges == NULL) {
+ if (m_ranges == nullptr) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) {
ASSERT_MODULE_LOCK(this);
- if (comp_unit.GetLineTable() != NULL)
+ if (comp_unit.GetLineTable() != nullptr)
return true;
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
case DW_TAG_inlined_subroutine:
case DW_TAG_subprogram:
case DW_TAG_lexical_block: {
- Block *block = NULL;
+ Block *block = nullptr;
if (tag == DW_TAG_subprogram) {
// Skip any DW_TAG_subprogram DIEs that are inside of a normal or
// inlined functions. These will be parsed on their own as separate
block = block_sp.get();
}
DWARFRangeList ranges;
- const char *name = NULL;
- const char *mangled_name = NULL;
+ const char *name = nullptr;
+ const char *mangled_name = nullptr;
int decl_file = 0;
int decl_line = 0;
block->FinalizeRanges();
if (tag != DW_TAG_subprogram &&
- (name != NULL || mangled_name != NULL)) {
+ (name != nullptr || mangled_name != nullptr)) {
std::unique_ptr<Declaration> decl_up;
if (decl_file != 0 || decl_line != 0 || decl_column != 0)
decl_up.reset(new Declaration(
}
return ResolveType(die);
}
- return NULL;
+ return nullptr;
}
// This function is used when SymbolFileDWARFDebugMap owns a bunch of
SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) {
// Check if the symbol vendor already knows about this compile unit?
- if (dwarf_cu->GetUserData() == NULL) {
+ if (dwarf_cu->GetUserData() == nullptr) {
// The symbol vendor doesn't know about this compile unit, we need to parse
// and add it to the symbol vendor object.
return ParseCompileUnit(dwarf_cu, cu_idx).get();
sc.comp_unit = GetCompUnitForDWARFCompUnit(die.GetCU(), UINT32_MAX);
sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function = ParseFunction(*sc.comp_unit, die);
if (sc.function) {
}
Status error = ModuleList::GetSharedModule(
- dwo_module_spec, module_sp, NULL, NULL, NULL);
+ dwo_module_spec, module_sp, nullptr, nullptr, nullptr);
if (!module_sp) {
GetObjectFile()->GetModule()->ReportWarning(
"0x%8.8x: unable to locate module needed for external types: "
if (function_die) {
sc.function =
sc.comp_unit->FindFunctionByUID(function_die.GetID()).get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function = ParseFunction(*sc.comp_unit, function_die);
if (sc.function && (resolve_scope & eSymbolContextBlock))
force_check_line_table = true;
}
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
resolved |= eSymbolContextFunction;
if (resolve_scope & eSymbolContextBlock) {
if ((resolve_scope & eSymbolContextLineEntry) ||
force_check_line_table) {
LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table != NULL) {
+ if (line_table != nullptr) {
// And address that makes it into this function should be in
// terms of this debug file if there is no debug map, or it
// will be an address in the .o file which needs to be fixed up
// only happen when there aren't other functions from other
// compile units in these gaps. This helps keep the size of the
// aranges down.
- sc.comp_unit = NULL;
+ sc.comp_unit = nullptr;
resolved &= ~eSymbolContextCompUnit;
}
} else {
DWARFDebugInfo *debug_info = DebugInfo();
if (debug_info) {
uint32_t cu_idx;
- DWARFUnit *dwarf_cu = NULL;
+ DWARFUnit *dwarf_cu = nullptr;
- for (cu_idx = 0; (dwarf_cu = debug_info->GetUnitAtIndex(cu_idx)) != NULL;
+ for (cu_idx = 0;
+ (dwarf_cu = debug_info->GetUnitAtIndex(cu_idx)) != nullptr;
++cu_idx) {
CompileUnit *dc_cu = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
const bool full_match = (bool)file_spec.GetDirectory();
bool file_spec_matches_cu_file_spec =
- dc_cu != NULL && FileSpec::Equal(file_spec, *dc_cu, full_match);
+ dc_cu != nullptr && FileSpec::Equal(file_spec, *dc_cu, full_match);
if (check_inlines || file_spec_matches_cu_file_spec) {
SymbolContext sc(m_obj_file->GetModule());
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
if (line != 0) {
LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table != NULL && line != 0) {
+ if (line_table != nullptr && line != 0) {
// We will have already looked up the file index if we are
// searching for inline entries.
if (!check_inlines)
found_line = sc.line_entry.line;
while (line_idx != UINT32_MAX) {
- sc.function = NULL;
- sc.block = NULL;
+ sc.function = nullptr;
+ sc.block = nullptr;
if (resolve_scope &
(eSymbolContextFunction | eSymbolContextBlock)) {
const lldb::addr_t file_vm_addr =
sc.comp_unit
->FindFunctionByUID(function_die.GetID())
.get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function =
ParseFunction(*sc.comp_unit, function_die);
function_die.LookupDeepestBlock(file_vm_addr);
}
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
Block &block = sc.function->GetBlock(true);
if (block_die)
return 0;
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
// Remember how many variables are in the list before we search.
}
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
// Remember how many variables are in the list before we search.
if (inlined_die) {
Block &function_block = sc.function->GetBlock(true);
sc.block = function_block.FindBlockByID(inlined_die.GetID());
- if (sc.block == NULL)
+ if (sc.block == nullptr)
sc.block = function_block.FindBlockByID(inlined_die.GetOffset());
- if (sc.block == NULL || !sc.block->GetStartAddress(addr))
+ if (sc.block == nullptr || !sc.block->GetStartAddress(addr))
addr.Clear();
} else {
- sc.block = NULL;
+ sc.block = nullptr;
addr = sc.function->GetAddressRange().GetBaseAddress();
}
const uint32_t original_size = sc_list.GetSize();
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
searched_symbol_files.insert(this);
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
TypeSP type_sp;
if (die) {
Type *type_ptr = GetDIEToType().lookup(die.GetDIE());
- if (type_ptr == NULL) {
+ if (type_ptr == nullptr) {
CompileUnit *lldb_cu = GetCompUnitForDWARFCompUnit(die.GetCU());
assert(lldb_cu);
SymbolContext sc(lldb_cu);
!GetFunction(DWARFDIE(die.GetCU(), parent_die), sc))
sc = sc_backup;
- type_sp = ParseType(sc, die, NULL);
+ type_sp = ParseType(sc, die, nullptr);
} else if (type_ptr != DIE_IS_BEING_PARSED) {
// Grab the existing type from the master types lists
type_sp = type_ptr->shared_from_this();
Symbol *
SymbolFileDWARF::GetObjCClassSymbol(ConstString objc_class_name) {
- Symbol *objc_class_symbol = NULL;
+ Symbol *objc_class_symbol = nullptr;
if (m_obj_file) {
Symtab *symtab = m_obj_file->GetSymtab();
if (symtab) {
size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
ASSERT_MODULE_LOCK(this);
- if (sc.comp_unit != NULL) {
+ if (sc.comp_unit != nullptr) {
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
if (sc.function) {
} else if (sc.comp_unit) {
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(sc.comp_unit->GetID());
- if (dwarf_cu == NULL)
+ if (dwarf_cu == nullptr)
return 0;
uint32_t vars_added = 0;
VariableListSP variables(sc.comp_unit->GetVariableList(false));
- if (variables.get() == NULL) {
+ if (variables.get() == nullptr) {
variables = std::make_shared<VariableList>();
sc.comp_unit->SetVariableList(variables);
const size_t num_attributes = die.GetAttributes(attributes);
DWARFDIE spec_die;
if (num_attributes > 0) {
- const char *name = NULL;
- const char *mangled = NULL;
+ const char *name = nullptr;
+ const char *mangled = nullptr;
Declaration decl;
uint32_t i;
DWARFFormValue type_die_form;
ValueType scope = eValueTypeInvalid;
const DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die);
- SymbolContextScope *symbol_context_scope = NULL;
+ SymbolContextScope *symbol_context_scope = nullptr;
bool has_explicit_mangled = mangled != nullptr;
if (!mangled) {
if (op_error) {
StreamString strm;
location.DumpLocationForAddress(&strm, eDescriptionLevelFull, 0, 0,
- NULL);
+ nullptr);
GetObjectFile()->GetModule()->ReportError(
"0x%8.8x: %s has an invalid location: %s", die.GetOffset(),
die.GetTagAsCString(), strm.GetData());
}
}
- if (symbol_context_scope == NULL) {
+ if (symbol_context_scope == nullptr) {
switch (parent_tag) {
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine:
if (sc.function) {
symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(
sc_parent_die.GetID());
- if (symbol_context_scope == NULL)
+ if (symbol_context_scope == nullptr)
symbol_context_scope = sc.function;
}
break;
// We haven't already parsed it, lets do that now.
if ((tag == DW_TAG_variable) || (tag == DW_TAG_constant) ||
(tag == DW_TAG_formal_parameter && sc.function)) {
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
DWARFDIE sc_parent_die = GetParentSymbolContextDIE(orig_die);
dw_tag_t parent_tag = sc_parent_die.Tag();
switch (parent_tag) {
case DW_TAG_compile_unit:
case DW_TAG_partial_unit:
- if (sc.comp_unit != NULL) {
+ if (sc.comp_unit != nullptr) {
variable_list_sp = sc.comp_unit->GetVariableList(false);
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
variable_list_sp = std::make_shared<VariableList>();
}
} else {
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine:
case DW_TAG_lexical_block:
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
// Check to see if we already have parsed the variables for the
// given scope
Block *block = sc.function->GetBlock(true).FindBlockByID(
sc_parent_die.GetID());
- if (block == NULL) {
+ if (block == nullptr) {
// This must be a specification or abstract origin with a
// concrete block counterpart in the current function. We need
// to find the concrete block so we can correctly add the
concrete_block_die.GetID());
}
- if (block != NULL) {
+ if (block != nullptr) {
const bool can_create = false;
variable_list_sp = block->GetBlockVariableList(can_create);
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
variable_list_sp = std::make_shared<VariableList>();
block->SetVariableList(variable_list_sp);
}
}
}
- bool skip_children = (sc.function == NULL && tag == DW_TAG_subprogram);
+ bool skip_children = (sc.function == nullptr && tag == DW_TAG_subprogram);
if (!skip_children && parse_children && die.HasChildren()) {
vars_added += ParseVariables(sc, die.GetFirstChild(), func_low_pc, true,
}
SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
- if (m_debug_map_symfile == NULL && !m_debug_map_module_wp.expired()) {
+ if (m_debug_map_symfile == nullptr && !m_debug_map_module_wp.expired()) {
lldb::ModuleSP module_sp(m_debug_map_module_wp.lock());
if (module_sp) {
SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
const DWARFDIE &orig_die,
const lldb::addr_t func_low_pc, bool parse_siblings,
bool parse_children,
- lldb_private::VariableList *cc_variable_list = NULL);
+ lldb_private::VariableList *cc_variable_list = nullptr);
bool ClassOrStructIsVirtual(const DWARFDIE &die);
SymbolVendor *
GetSymbolVendor(bool can_create = true,
- lldb_private::Stream *feedback_strm = NULL) override {
+ lldb_private::Stream *feedback_strm = nullptr) override {
// Scope for locker
if (m_symfile_up.get() || !can_create)
return m_symfile_up.get();
symbol_vendor->GetSymbolFile());
if (!oso_symfile)
- return NULL;
+ return nullptr;
ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
SymbolVendor *exe_sym_vendor = exe_module_sp->GetSymbolVendor();
}
}
}
- return NULL;
+ return nullptr;
}
protected:
oso_symbol->GetName().GetCString());
}
} else {
- if (oso_symbol == NULL)
+ if (oso_symbol == nullptr)
m_obj_file->GetModule()->ReportError(
"N_OSO symbol[%u] can't be found, please file a bug and attach "
"the binary listed in this error",
oso_idx);
- else if (so_symbol == NULL)
+ else if (so_symbol == nullptr)
m_obj_file->GetModule()->ReportError(
"N_SO not found for N_OSO symbol[%u], please file a bug and "
"attach the binary listed in this error",
const uint32_t cu_count = GetNumCompileUnits();
if (oso_idx < cu_count)
return GetModuleByCompUnitInfo(&m_compile_unit_infos[oso_idx]);
- return NULL;
+ return nullptr;
}
Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
") since this executable was linked, file will be ignored",
oso_file.GetPath().c_str(), llvm::to_string(oso_mod_time).c_str(),
llvm::to_string(comp_unit_info->oso_mod_time).c_str());
- return NULL;
+ return nullptr;
}
} else {
if (!ObjectFile::SplitArchivePathWithObject(oso_path, oso_file,
oso_object, must_exist)) {
- return NULL;
+ return nullptr;
}
}
// Always create a new module for .o files. Why? Because we use the debug
}
if (comp_unit_info->oso_sp)
return comp_unit_info->oso_sp->module_sp.get();
- return NULL;
+ return nullptr;
}
bool SymbolFileDWARFDebugMap::GetFileSpecForSO(uint32_t oso_idx,
Module *oso_module = GetModuleByOSOIndex(oso_idx);
if (oso_module)
return oso_module->GetObjectFile();
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *
CompileUnitInfo *comp_unit_info = GetCompUnitInfo(comp_unit);
if (comp_unit_info)
return GetSymbolFileByCompUnitInfo(comp_unit_info);
- return NULL;
+ return nullptr;
}
ObjectFile *SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo(
Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
if (oso_module)
return oso_module->GetObjectFile();
- return NULL;
+ return nullptr;
}
uint32_t SymbolFileDWARFDebugMap::GetCompUnitInfoIndex(
unsigned size = m_compile_unit_infos.size();
if (oso_idx < size)
return GetSymbolFileByCompUnitInfo(&m_compile_unit_infos[oso_idx]);
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *
if (sym_file &&
sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
return (SymbolFileDWARF *)sym_file;
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo(
if (sym_vendor)
return GetSymbolFileAsSymbolFileDWARF(sym_vendor->GetSymbolFile());
}
- return NULL;
+ return nullptr;
}
uint32_t SymbolFileDWARFDebugMap::CalculateAbilities() {
if (comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
return &m_compile_unit_infos[i];
}
- return NULL;
+ return nullptr;
}
size_t SymbolFileDWARFDebugMap::GetCompUnitInfosForModule(
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
if (oso_dwarf)
return oso_dwarf->ResolveTypeUID(type_uid);
- return NULL;
+ return nullptr;
}
llvm::Optional<SymbolFile::ArrayInfo>
sc.symbol =
symtab->SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
- if (sc.symbol != NULL) {
+ if (sc.symbol != nullptr) {
resolved_flags |= eSymbolContextSymbol;
uint32_t oso_idx = 0;
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex(
uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
const uint32_t oso_index_count = m_compile_unit_infos.size();
- CompileUnitInfo *comp_unit_info = NULL;
+ CompileUnitInfo *comp_unit_info = nullptr;
if (oso_index_count) {
comp_unit_info = (CompileUnitInfo *)bsearch(
&symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
}
if (oso_idx_ptr) {
- if (comp_unit_info != NULL)
+ if (comp_unit_info != nullptr)
*oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
else
*oso_idx_ptr = UINT32_MAX;
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID(
user_id_t symbol_id, uint32_t *oso_idx_ptr) {
const uint32_t oso_index_count = m_compile_unit_infos.size();
- CompileUnitInfo *comp_unit_info = NULL;
+ CompileUnitInfo *comp_unit_info = nullptr;
if (oso_index_count) {
comp_unit_info = (CompileUnitInfo *)::bsearch(
&symbol_id, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
}
if (oso_idx_ptr) {
- if (comp_unit_info != NULL)
+ if (comp_unit_info != nullptr)
*oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
else
*oso_idx_ptr = UINT32_MAX;
type_mask);
uint32_t initial_size = type_list.GetSize();
- SymbolFileDWARF *oso_dwarf = NULL;
+ SymbolFileDWARF *oso_dwarf = nullptr;
if (sc_scope) {
SymbolContext sc;
sc_scope->CalculateSymbolContext(&sc);
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
if (skip_dwarf_oso != oso_dwarf &&
- oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(NULL)) {
+ oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
return true;
}
// contain the implementation definition since it will be scoped inside the
// N_SO and we can then locate the SymbolFileDWARF that corresponds to that
// N_SO.
- SymbolFileDWARF *oso_dwarf = NULL;
+ SymbolFileDWARF *oso_dwarf = nullptr;
TypeSP type_sp;
ObjectFile *module_objfile = m_obj_file->GetModule()->GetObjectFile();
if (module_objfile) {
if (source_file_symbol_idx != UINT32_MAX) {
CompileUnitInfo *compile_unit_info =
GetCompileUnitInfoForSymbolWithIndex(source_file_symbol_idx,
- NULL);
+ nullptr);
if (compile_unit_info) {
oso_dwarf = GetSymbolFileByCompUnitInfo(compile_unit_info);
if (oso_dwarf) {
}
}
}
- return NULL;
+ return nullptr;
}
void SymbolFileDWARFDebugMap::SetCompileUnit(SymbolFileDWARF *oso_dwarf,
CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_dwarf);
if (cu_info)
return line_table->LinkLineTable(cu_info->GetFileRangeMap(this));
- return NULL;
+ return nullptr;
}
size_t
case DW_TAG_namespace: {
const char *parent_arg_die_name = parent_arg_die.GetName();
if (parent_arg_die_name ==
- NULL) // Anonymous (i.e. no-name) struct
+ nullptr) // Anonymous (i.e. no-name) struct
{
match = false;
} else {
const char *parent_pos_die_name = parent_pos_die.GetName();
- if (parent_pos_die_name == NULL ||
+ if (parent_pos_die_name == nullptr ||
((parent_arg_die_name != parent_pos_die_name) &&
strcmp(parent_arg_die_name, parent_pos_die_name)))
match = false;
size_t num_added = 0;
// We must at least have a valid compile unit
const Symtab *symtab = m_obj_file->GetSymtab();
- const Symbol *curr_symbol = NULL;
- const Symbol *next_symbol = NULL;
+ const Symbol *curr_symbol = nullptr;
+ const Symbol *next_symbol = nullptr;
// const char *prefix = m_obj_file->SymbolPrefix();
// if (prefix == NULL)
// prefix == "";
LLDB_INVALID_UID, // We don't have any type info
// for this function
curr_symbol->GetMangled(), // Linker/mangled name
- NULL, // no return type for a code symbol...
+ nullptr, // no return type for a code symbol...
func_range)); // first address range
- if (func_sp.get() != NULL) {
+ if (func_sp.get() != nullptr) {
comp_unit.AddFunction(func_sp);
++num_added;
}
}
Type *SymbolFileSymtab::ResolveTypeUID(lldb::user_id_t type_uid) {
- return NULL;
+ return nullptr;
}
llvm::Optional<SymbolFile::ArrayInfo>
uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr,
SymbolContextItem resolve_scope,
SymbolContext &sc) {
- if (m_obj_file->GetSymtab() == NULL)
+ if (m_obj_file->GetSymtab() == nullptr)
return 0;
uint32_t resolved_flags = 0;
SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
lldb_private::Stream *feedback_strm) {
if (!module_sp)
- return NULL;
+ return nullptr;
ObjectFile *obj_file = module_sp->GetObjectFile();
if (!obj_file)
- return NULL;
+ return nullptr;
static ConstString obj_file_elf("elf");
ConstString obj_name = obj_file->GetPluginName();
if (obj_name != obj_file_elf)
- return NULL;
+ return nullptr;
lldb_private::UUID uuid = obj_file->GetUUID();
if (!uuid)
- return NULL;
+ return nullptr;
// Get the .gnu_debuglink file (if specified).
FileSpecList file_spec_list = obj_file->GetDebugSymbolFilePaths();
// If we have no debug symbol files, then nothing to do.
if (file_spec_list.IsEmpty())
- return NULL;
+ return nullptr;
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
}
}
}
- return NULL;
+ return nullptr;
}
// PluginInterface protocol
// function:
if (!m_get_item_info_impl_code) {
- if (g_get_item_info_function_code != NULL) {
+ if (g_get_item_info_function_code != nullptr) {
Status error;
m_get_item_info_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
// First stage is to make the ClangUtility to hold our injected function:
if (!m_get_pending_items_impl_code) {
- if (g_get_pending_items_function_code != NULL) {
+ if (g_get_pending_items_function_code != nullptr) {
Status error;
m_get_pending_items_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
options.SetIsForUtilityExpr(true);
thread.CalculateExecutionContext(exe_ctx);
- if (get_pending_items_caller == NULL) {
+ if (get_pending_items_caller == nullptr) {
error.SetErrorString("Unable to compile function to call "
"__introspection_dispatch_queue_get_pending_items");
return return_value;
// First stage is to make the ClangUtility to hold our injected function:
if (!m_get_queues_impl_code_up) {
- if (g_get_current_queues_function_code != NULL) {
+ if (g_get_current_queues_function_code != nullptr) {
Status error;
m_get_queues_impl_code_up.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
FunctionCaller *get_queues_caller =
m_get_queues_impl_code_up->GetFunctionCaller();
- if (get_queues_caller == NULL) {
+ if (get_queues_caller == nullptr) {
error.SetErrorString(
"Unable to get caller for call __introspection_dispatch_get_queues");
return return_value;
if (!m_get_thread_item_info_impl_code) {
Status error;
- if (g_get_thread_item_info_function_code != NULL) {
+ if (g_get_thread_item_info_function_code != nullptr) {
m_get_thread_item_info_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
g_get_thread_item_info_function_code, eLanguageTypeC,
if (create)
return new SystemRuntimeMacOSX(process);
- return NULL;
+ return nullptr;
}
// Constructor
m_process->ClearBreakpointSiteByID(m_break_id);
if (clear_process)
- m_process = NULL;
+ m_process = nullptr;
m_break_id = LLDB_INVALID_BREAK_ID;
}
static ConstString g_dispatch_queue_offsets_symbol_name(
"dispatch_queue_offsets");
- const Symbol *dispatch_queue_offsets_symbol = NULL;
+ const Symbol *dispatch_queue_offsets_symbol = nullptr;
// libdispatch symbols were in libSystem.B.dylib up through Mac OS X 10.6
// ("Snow Leopard")
// libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion")
// and later
- if (dispatch_queue_offsets_symbol == NULL) {
+ if (dispatch_queue_offsets_symbol == nullptr) {
ModuleSpec libdispatch_module_spec(FileSpec("libdispatch.dylib"));
module_sp = m_process->GetTarget().GetImages().FindFirstModule(
libdispatch_module_spec);
static ConstString g_libpthread_layout_offsets_symbol_name(
"pthread_layout_offsets");
- const Symbol *libpthread_layout_offsets_symbol = NULL;
+ const Symbol *libpthread_layout_offsets_symbol = nullptr;
ModuleSpec libpthread_module_spec(FileSpec("libsystem_pthread.dylib"));
ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule(
static ConstString g_libdispatch_tsd_indexes_symbol_name(
"dispatch_tsd_indexes");
- const Symbol *libdispatch_tsd_indexes_symbol = NULL;
+ const Symbol *libdispatch_tsd_indexes_symbol = nullptr;
ModuleSpec libpthread_module_spec(FileSpec("libdispatch.dylib"));
ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule(
for (ThreadSP thread_sp : m_process->Threads()) {
if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) {
if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) {
- if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() == NULL) {
+ if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() ==
+ nullptr) {
QueueSP queue_sp(new Queue(m_process->shared_from_this(),
thread_sp->GetQueueID(),
thread_sp->GetQueueName()));
offset = start_of_this_item +
m_lib_backtrace_recording_info.queue_info_data_offset;
const char *queue_label = extractor.GetCStr(&offset);
- if (queue_label == NULL)
+ if (queue_label == nullptr)
queue_label = "";
offset_t start_of_next_item = start_of_this_item + offset_to_next;
const bool prefer_file_cache = true;
DisassemblerSP disasm_sp(Disassembler::DisassembleBytes(
- m_arch, NULL, NULL, range.GetBaseAddress(), opcode_data, opcode_size,
- 99999, prefer_file_cache));
+ m_arch, nullptr, nullptr, range.GetBaseAddress(), opcode_data,
+ opcode_size, 99999, prefer_file_cache));
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
lldb_private::FormatEntity::Entry format;
FormatEntity::Parse("${frame.pc}: ", format);
inst->Dump(&strm, inst_list.GetMaxOpcocdeByteSize(), show_address,
- show_bytes, NULL, NULL, NULL, &format, 0);
+ show_bytes, nullptr, nullptr, nullptr, &format, 0);
log->PutString(strm.GetString());
}
UnwindAssemblyInstEmulation::CreateInstance(const ArchSpec &arch) {
std::unique_ptr<EmulateInstruction> inst_emulator_up(
EmulateInstruction::FindPlugin(arch, eInstructionTypePrologueEpilogue,
- NULL));
+ nullptr));
// Make sure that all prologue instructions are handled
if (inst_emulator_up)
return new UnwindAssemblyInstEmulation(arch, inst_emulator_up.release());
- return NULL;
+ return nullptr;
}
// PluginInterface protocol in UnwindAssemblyParser_x86
UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch,
lldb_private::EmulateInstruction *inst_emulator)
: UnwindAssembly(arch), m_inst_emulator_up(inst_emulator),
- m_range_ptr(NULL), m_unwind_plan_ptr(NULL), m_curr_row(),
+ m_range_ptr(nullptr), m_unwind_plan_ptr(nullptr), m_curr_row(),
m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(),
m_pushed_regs(), m_curr_row_modified(false),
m_forward_branch_offset(0) {
const llvm::Triple::ArchType cpu = arch.GetMachine();
if (cpu == llvm::Triple::x86 || cpu == llvm::Triple::x86_64)
return new UnwindAssembly_x86(arch);
- return NULL;
+ return nullptr;
}
// PluginInterface protocol in UnwindAssemblyParser_x86
} else {
child_is_deref_of_parent = true;
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '*');
child_name += parent_name;
child_is_deref_of_parent = true;
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '*');
child_name += parent_name;
language_flags);
} else {
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '&');
child_name += parent_name;
llvm::dyn_cast<clang::EnumType>(ClangUtil::GetCanonicalQualType(type));
if (enutype)
return enutype->getDecl();
- return NULL;
+ return nullptr;
}
clang::RecordDecl *ClangASTContext::GetAsRecordDecl(const CompilerType &type) {
if (is_attr_used)
cxx_method_decl->addAttr(clang::UsedAttr::CreateImplicit(*getASTContext()));
- if (mangled_name != NULL) {
+ if (mangled_name != nullptr) {
cxx_method_decl->addAttr(
clang::AsmLabelAttr::CreateImplicit(*getASTContext(), mangled_name));
}
template_basename.c_str(), tag_decl_kind,
template_param_infos);
}
- return NULL;
+ return nullptr;
}
void ClangASTContext::CompleteTagDecl(void *baton, clang::TagDecl *decl) {
const clang::CXXRecordDecl *cxx_record_decl =
qual_type->getAsCXXRecordDecl();
if (cxx_record_decl) {
- if (ResolveDeclOrigin(cxx_record_decl, NULL, NULL))
+ if (ResolveDeclOrigin(cxx_record_decl, nullptr, nullptr))
return true;
}
} break;
clang::EnumDecl *enum_decl =
llvm::cast<clang::EnumType>(qual_type)->getDecl();
if (enum_decl) {
- if (ResolveDeclOrigin(enum_decl, NULL, NULL))
+ if (ResolveDeclOrigin(enum_decl, nullptr, nullptr))
return true;
}
} break;
// We currently can't complete objective C types through the newly added
// ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
- if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
+ if (ResolveDeclOrigin(class_interface_decl, nullptr, nullptr))
return true;
}
}
const clang::CXXRecordDecl *cxx_record_decl =
qual_type->getAsCXXRecordDecl();
if (cxx_record_decl) {
- if (ResolveDeclOrigin(cxx_record_decl, NULL, NULL))
+ if (ResolveDeclOrigin(cxx_record_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
} break;
clang::EnumDecl *enum_decl =
llvm::cast<clang::EnumType>(qual_type)->getDecl();
if (enum_decl) {
- if (ResolveDeclOrigin(enum_decl, NULL, NULL))
+ if (ResolveDeclOrigin(enum_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
} break;
// We currently can't complete objective C types through the newly added
// ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
- if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
+ if (ResolveDeclOrigin(class_interface_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
}
if (log && log->GetVerbose()) {
StreamString strm;
addr.Dump(
- &strm, NULL,
+ &strm, nullptr,
Address::DumpStyle::DumpStyleResolvedDescriptionNoFunctionArguments,
Address::DumpStyle::DumpStyleFileAddress,
arch.GetAddressByteSize());
return false;
auto byte_size =
- GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
+ GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
if (!byte_size)
return false;
return false;
auto byte_size =
- GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
+ GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
if (!byte_size)
return false;
bool got_spec = module_specs.GetModuleSpecAtIndex(i, spec);
UNUSED_IF_ASSERT_DISABLED(got_spec);
assert(got_spec);
- if ((uuid == NULL || (spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
- (arch == NULL || (spec.GetArchitecturePtr() &&
- spec.GetArchitecture().IsCompatibleMatch(*arch)))) {
+ if ((uuid == nullptr || (spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
+ (arch == nullptr ||
+ (spec.GetArchitecturePtr() &&
+ spec.GetArchitecture().IsCompatibleMatch(*arch)))) {
return true;
}
}
}
#ifdef LLDB_CONFIGURATION_DEBUG
else {
- ObjectFile *objfile = NULL;
+ ObjectFile *objfile = nullptr;
if (module_sp) {
SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
if (symbol_vendor) {
return symbol;
}
}
- return NULL;
+ return nullptr;
}
}
return m_static_type.GetTypeSystem();
}
- return NULL;
+ return nullptr;
}
bool TypeImpl::GetDescription(lldb_private::Stream &strm,
return llvm::Regex::escape(first_template_parameter.str()) +
R"(::operator\(\)\(.*\))";
- if (symbol != NULL &&
+ if (symbol != nullptr &&
symbol->GetName().GetStringRef().contains("__invoke")) {
llvm::StringRef symbol_name = symbol->GetName().GetStringRef();
Status error = PrivateResume();
if (error.Success()) {
StateType state =
- WaitForProcessToStop(llvm::None, NULL, true, listener_sp, stream);
+ WaitForProcessToStop(llvm::None, nullptr, true, listener_sp, stream);
const bool must_be_alive =
false; // eStateExited is ok, so this must be false
if (!StateIsStoppedState(state, must_be_alive))
}
if (signal == eBroadcastInternalStateControlStop) {
- thread_result_t result = NULL;
+ thread_result_t result = nullptr;
m_private_state_thread.Join(&result);
m_private_state_thread.Reset();
}
// it was doing yet, so don't try to change it on the way out.
if (!is_secondary_thread)
m_public_run_lock.SetStopped();
- return NULL;
+ return nullptr;
}
// Process Event Data
std::lock_guard<std::recursive_mutex> guard(m_mutex);
SectionLoadList *section_load_list =
GetSectionLoadListForStopID(eStopIDNow, read_only);
- assert(section_load_list != NULL);
+ assert(section_load_list != nullptr);
return *section_load_list;
}
address_loc += (sizeof(address_string) - 1);
- uint64_t address = strtoull(address_loc, 0, 0);
+ uint64_t address = strtoull(address_loc, nullptr, 0);
if (crashing_address) {
*crashing_address = address;
}
"Queueing StepInRange plan to step through line 0 code.");
return_plan_sp = current_plan->GetThread().QueueThreadPlanForStepInRange(
- false, range, sc, NULL, eOnlyDuringStepping, status,
+ false, range, sc, nullptr, eOnlyDuringStepping, status,
eLazyBoolCalculate, eLazyBoolNo);
}
}
}
lldb::SBLaunchInfo sbLaunchInfo = sbTarget.GetLaunchInfo();
- sbLaunchInfo.SetArguments(NULL, false);
+ sbLaunchInfo.SetArguments(nullptr, false);
CMIUtilString strArg;
size_t nArgIndex = 0;
while (pArgArguments->GetExpectedOption<CMICmdArgValString, CMIUtilString>(
strArg, nArgIndex)) {
- const char *argv[2] = {strArg.c_str(), NULL};
+ const char *argv[2] = {strArg.c_str(), nullptr};
sbLaunchInfo.SetArguments(argv, true);
++nArgIndex;
}
// If the current target is invalid, create one
lldb::SBTarget target = rSessionInfo.GetTarget();
if (!target.IsValid()) {
- target = rSessionInfo.GetDebugger().CreateTarget(NULL);
+ target = rSessionInfo.GetDebugger().CreateTarget(nullptr);
if (!target.IsValid()) {
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT),
m_cmdData.strMiCmd.c_str()));
// Return: None.
// Throws: None.
//--
-CMICmnBase::~CMICmnBase() { m_pLog = NULL; }
+CMICmnBase::~CMICmnBase() { m_pLog = nullptr; }
//++
// Details: Retrieve whether *this object has an error description set.
return "";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
- return NULL;
+ return nullptr;
}
static const char *
return "&";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
- return NULL;
+ return nullptr;
}
//++
return "exit";
}
assert(false && "unknown CMICmnMIResultRecord::ResultClass_e");
- return NULL;
+ return nullptr;
}
//++
//--
CMIDriver::CMIDriver()
: m_bFallThruToOtherDriverEnabled(false), m_bDriverIsExiting(false),
- m_handleMainThread(0), m_rStdin(CMICmnStreamStdin::Instance()),
+ m_handleMainThread(nullptr), m_rStdin(CMICmnStreamStdin::Instance()),
m_rLldbDebugger(CMICmnLLDBDebugger::Instance()),
m_rStdOut(CMICmnStreamStdout::Instance()),
m_eCurrentDriverState(eDriverState_NotRunning),
// available before *this driver has been initialized! Flaw?
// Do not want to pass through driver to write to stdout
- return NULL;
+ return nullptr;
}
//++
// Return: None.
// Throws: None.
//--
-CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = NULL; }
+CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = nullptr; }
//++
// Details: This function allows *this driver to call on another driver to
}
m_mapDriverIdToDriver.clear();
- m_pDriverCurrent = NULL;
+ m_pDriverCurrent = nullptr;
return MIstatus::success;
}
static struct option g_long_options[] = {
{"debug", no_argument, &g_debug, 1},
{"verbose", no_argument, &g_verbose, 1},
- {"log-file", required_argument, NULL, 'l'},
- {"log-channels", required_argument, NULL, 'c'},
- {"attach", required_argument, NULL, 'a'},
- {"named-pipe", required_argument, NULL, 'N'},
- {"pipe", required_argument, NULL, 'U'},
- {"native-regs", no_argument, NULL,
+ {"log-file", required_argument, nullptr, 'l'},
+ {"log-channels", required_argument, nullptr, 'c'},
+ {"attach", required_argument, nullptr, 'a'},
+ {"named-pipe", required_argument, nullptr, 'N'},
+ {"pipe", required_argument, nullptr, 'U'},
+ {"native-regs", no_argument, nullptr,
'r'}, // Specify to use the native registers instead of the gdb defaults
// for the architecture. NOTE: this is a do-nothing arg as it's
// behavior is default now. FIXME remove call from lldb-platform.
- {"reverse-connect", no_argument, NULL,
+ {"reverse-connect", no_argument, nullptr,
'R'}, // Specifies that llgs attaches to the client address:port rather
// than llgs listening for a connection from address on port.
- {"setsid", no_argument, NULL,
+ {"setsid", no_argument, nullptr,
'S'}, // Call setsid() to make llgs run in its own session.
- {"fd", required_argument, NULL, 'F'},
- {NULL, 0, NULL, 0}};
+ {"fd", required_argument, nullptr, 'F'},
+ {nullptr, 0, nullptr, 0}};
// Watch for signals
static int g_sighup_received_count = 0;
static struct option g_long_options[] = {
{"debug", no_argument, &g_debug, 1},
{"verbose", no_argument, &g_verbose, 1},
- {"log-file", required_argument, NULL, 'l'},
- {"log-channels", required_argument, NULL, 'c'},
- {"listen", required_argument, NULL, 'L'},
- {"port-offset", required_argument, NULL, 'p'},
- {"gdbserver-port", required_argument, NULL, 'P'},
- {"min-gdbserver-port", required_argument, NULL, 'm'},
- {"max-gdbserver-port", required_argument, NULL, 'M'},
- {"socket-file", required_argument, NULL, 'f'},
+ {"log-file", required_argument, nullptr, 'l'},
+ {"log-channels", required_argument, nullptr, 'c'},
+ {"listen", required_argument, nullptr, 'L'},
+ {"port-offset", required_argument, nullptr, 'p'},
+ {"gdbserver-port", required_argument, nullptr, 'P'},
+ {"min-gdbserver-port", required_argument, nullptr, 'm'},
+ {"max-gdbserver-port", required_argument, nullptr, 'M'},
+ {"socket-file", required_argument, nullptr, 'f'},
{"server", no_argument, &g_server, 1},
- {NULL, 0, NULL, 0}};
+ {nullptr, 0, nullptr, 0}};
#if defined(__APPLE__)
#define LOW_PORT (IPPORT_RESERVED)
ASSERT_EQ(UINT64_MAX, ex.GetFilePos());
ASSERT_EQ(false, ex.Empty());
ASSERT_EQ(0u, ex.GetBytesLeft());
- ASSERT_EQ(0, ex.Peek());
+ ASSERT_EQ(nullptr, ex.Peek());
}
TEST_F(StringExtractorTest, GetHexBytes_Partial) {
}
// Cause a break.
- volatile char *p = NULL;
+ volatile char *p = nullptr;
*p = 'a';
delay.store(false);
LLDB_INVALID_REGNUM, // process plugin reg num
LLDB_INVALID_REGNUM // native register number
},
- NULL,
- NULL,
- NULL, // Dwarf expression opcode bytes pointer
- 0 // Dwarf expression opcode bytes length
+ nullptr,
+ nullptr,
+ nullptr, // Dwarf expression opcode bytes pointer
+ 0 // Dwarf expression opcode bytes length
};
Info.name = ConstString(Elements["name"]).GetCString();
if (!Info.name)
template <typename AltPairT>
DenseMapPair(AltPairT &&AltPair,
typename std::enable_if<std::is_convertible<
- AltPairT, std::pair<KeyT, ValueT>>::value>::type * = 0)
+ AltPairT, std::pair<KeyT, ValueT>>::value>::type * = nullptr)
: std::pair<KeyT, ValueT>(std::forward<AltPairT>(AltPair)) {}
KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
void output(OutputStream &OS, OutputFlags Flags, StringView Separator) const;
- Node **Nodes = 0;
+ Node **Nodes = nullptr;
size_t Count = 0;
};