Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/API and source/API; other minor fixes.
Other fixes should reduce number of readability-redundant-smartptr-get and readability-implicit-bool-cast.
llvm-svn: 251733
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index dd4c80c..1f58ddb 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBBreakpointLocation.h"
#include "lldb/API/SBDebugger.h"
@@ -32,7 +36,6 @@
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
-
#include "lldb/lldb-enumerations.h"
using namespace lldb;
@@ -47,7 +50,6 @@
class SBBreakpointCallbackBaton : public Baton
{
public:
-
SBBreakpointCallbackBaton (SBBreakpoint::BreakpointHitCallback callback, void *baton) :
Baton (new CallbackData)
{
@@ -56,19 +58,18 @@
data->callback_baton = baton;
}
- virtual ~SBBreakpointCallbackBaton()
+ ~SBBreakpointCallbackBaton() override
{
CallbackData *data = (CallbackData *)m_data;
if (data)
{
delete data;
- m_data = NULL;
+ m_data = nullptr;
}
}
};
-
SBBreakpoint::SBBreakpoint () :
m_opaque_sp ()
{
@@ -79,15 +80,12 @@
{
}
-
SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
m_opaque_sp (bp_sp)
{
}
-SBBreakpoint::~SBBreakpoint()
-{
-}
+SBBreakpoint::~SBBreakpoint() = default;
const SBBreakpoint &
SBBreakpoint::operator = (const SBBreakpoint& rhs)
@@ -135,7 +133,6 @@
return break_id;
}
-
bool
SBBreakpoint::IsValid() const
{
@@ -169,7 +166,7 @@
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
Address address;
Target &target = m_opaque_sp->GetTarget();
- if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
+ if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
{
address.SetRawAddress (vm_addr);
}
@@ -189,7 +186,7 @@
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
Address address;
Target &target = m_opaque_sp->GetTarget();
- if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
+ if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
{
address.SetRawAddress (vm_addr);
}
@@ -329,7 +326,7 @@
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
return m_opaque_sp->GetConditionText ();
}
- return NULL;
+ return nullptr;
}
uint32_t
@@ -380,7 +377,6 @@
if (log)
log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")",
static_cast<void*>(m_opaque_sp.get()), tid);
-
}
tid_t
@@ -422,7 +418,7 @@
{
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
- if (thread_spec != NULL)
+ if (thread_spec != nullptr)
thread_idx = thread_spec->GetIndex();
}
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -451,12 +447,12 @@
const char *
SBBreakpoint::GetThreadName () const
{
- const char *name = NULL;
+ const char *name = nullptr;
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
- if (thread_spec != NULL)
+ if (thread_spec != nullptr)
name = thread_spec->GetName();
}
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -484,7 +480,7 @@
const char *
SBBreakpoint::GetQueueName () const
{
- const char *name = NULL;
+ const char *name = nullptr;
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
@@ -552,13 +548,10 @@
}
bool
-SBBreakpoint::PrivateBreakpointHitCallback
-(
- void *baton,
- StoppointCallbackContext *ctx,
- lldb::user_id_t break_id,
- lldb::user_id_t break_loc_id
-)
+SBBreakpoint::PrivateBreakpointHitCallback(void *baton,
+ StoppointCallbackContext *ctx,
+ lldb::user_id_t break_id,
+ lldb::user_id_t break_loc_id)
{
ExecutionContext exe_ctx (ctx->exe_ctx_ref);
BreakpointSP bp_sp(exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
@@ -758,8 +751,7 @@
bool
SBBreakpoint::EventIsBreakpointEvent (const lldb::SBEvent &event)
{
- return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) != NULL;
-
+ return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) != nullptr;
}
BreakpointEventType
@@ -796,5 +788,3 @@
num_locations = (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (event.GetSP()));
return num_locations;
}
-
-
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index cd1e28e..21f431d 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/lldb-types.h"
#include "lldb/Core/Listener.h"
@@ -34,10 +38,7 @@
m_opaque_up.reset(new CommandInterpreterRunOptions());
}
-SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions()
-{
-
-}
+SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;
bool
SBCommandInterpreterRunOptions::GetStopOnContinue () const
@@ -126,21 +127,24 @@
class CommandPluginInterfaceImplementation : public CommandObjectParsed
{
public:
- CommandPluginInterfaceImplementation (CommandInterpreter &interpreter,
- const char *name,
- lldb::SBCommandPluginInterface* backend,
- const char *help = NULL,
- const char *syntax = NULL,
- uint32_t flags = 0) :
+ CommandPluginInterfaceImplementation(CommandInterpreter &interpreter,
+ const char *name,
+ lldb::SBCommandPluginInterface* backend,
+ const char *help = nullptr,
+ const char *syntax = nullptr,
+ uint32_t flags = 0) :
CommandObjectParsed (interpreter, name, help, syntax, flags),
m_backend(backend) {}
- virtual bool
- IsRemovable() const { return true; }
+ bool
+ IsRemovable() const override
+ {
+ return true;
+ }
protected:
- virtual bool
- DoExecute (Args& command, CommandReturnObject &result)
+ bool
+ DoExecute(Args& command, CommandReturnObject &result) override
{
SBCommandReturnObject sb_return(&result);
SBCommandInterpreter sb_interpreter(&m_interpreter);
@@ -169,6 +173,8 @@
{
}
+SBCommandInterpreter::~SBCommandInterpreter() = default;
+
const SBCommandInterpreter &
SBCommandInterpreter::operator = (const SBCommandInterpreter &rhs)
{
@@ -176,47 +182,34 @@
return *this;
}
-SBCommandInterpreter::~SBCommandInterpreter ()
-{
-}
-
bool
SBCommandInterpreter::IsValid() const
{
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
-
bool
-SBCommandInterpreter::CommandExists (const char *cmd)
+SBCommandInterpreter::CommandExists(const char *cmd)
{
- if (cmd && m_opaque_ptr)
- return m_opaque_ptr->CommandExists (cmd);
- return false;
+ return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->CommandExists(cmd) : false);
}
bool
SBCommandInterpreter::AliasExists (const char *cmd)
{
- if (cmd && m_opaque_ptr)
- return m_opaque_ptr->AliasExists (cmd);
- return false;
+ return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->AliasExists(cmd) : false);
}
bool
-SBCommandInterpreter::IsActive ()
+SBCommandInterpreter::IsActive()
{
- if (m_opaque_ptr)
- return m_opaque_ptr->IsActive ();
- return false;
+ return (IsValid() ? m_opaque_ptr->IsActive() : false);
}
const char *
SBCommandInterpreter::GetIOHandlerControlSequence(char ch)
{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence (ch).GetCString();
- return NULL;
+ return (IsValid() ? m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence(ch).GetCString() : nullptr);
}
lldb::ReturnStatus
@@ -247,7 +240,7 @@
result.Clear();
- if (command_line && m_opaque_ptr)
+ if (command_line && IsValid())
{
result.ref().SetInteractive(false);
m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref(), ctx_ptr);
@@ -290,7 +283,7 @@
static_cast<void*>(result.get()));
}
- if (!m_opaque_ptr)
+ if (!IsValid())
{
result->AppendError ("SBCommandInterpreter is not valid.");
result->SetStatus (eReturnStatusFailed);
@@ -315,12 +308,9 @@
else
ctx_ptr = nullptr;
-
m_opaque_ptr->HandleCommandsFromFile (tmp_spec, ctx_ptr, options.ref(), result.ref());
-
}
-
int
SBCommandInterpreter::HandleCompletion (const char *current_line,
const char *cursor,
@@ -334,7 +324,7 @@
// Sanity check the arguments that are passed in:
// cursor & last_char have to be within the current_line.
- if (current_line == NULL || cursor == NULL || last_char == NULL)
+ if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
return 0;
if (cursor < current_line || last_char < current_line)
@@ -352,11 +342,11 @@
static_cast<uint64_t>(last_char - current_line),
match_start_point, max_return_elements);
- if (m_opaque_ptr)
+ if (IsValid())
{
lldb_private::StringList lldb_matches;
- num_completions = m_opaque_ptr->HandleCompletion (current_line, cursor, last_char, match_start_point,
- max_return_elements, lldb_matches);
+ num_completions = m_opaque_ptr->HandleCompletion(current_line, cursor, last_char, match_start_point,
+ max_return_elements, lldb_matches);
SBStringList temp_list (&lldb_matches);
matches.AppendList (temp_list);
@@ -381,27 +371,21 @@
}
bool
-SBCommandInterpreter::HasCommands ()
+SBCommandInterpreter::HasCommands()
{
- if (m_opaque_ptr)
- return m_opaque_ptr->HasCommands();
- return false;
+ return (IsValid() ? m_opaque_ptr->HasCommands() : false);
}
bool
-SBCommandInterpreter::HasAliases ()
+SBCommandInterpreter::HasAliases()
{
- if (m_opaque_ptr)
- return m_opaque_ptr->HasAliases();
- return false;
+ return (IsValid() ? m_opaque_ptr->HasAliases() : false);
}
bool
-SBCommandInterpreter::HasAliasOptions ()
+SBCommandInterpreter::HasAliasOptions()
{
- if (m_opaque_ptr)
- return m_opaque_ptr->HasAliasOptions ();
- return false;
+ return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
}
SBProcess
@@ -409,7 +393,7 @@
{
SBProcess sb_process;
ProcessSP process_sp;
- if (m_opaque_ptr)
+ if (IsValid())
{
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
if (target_sp)
@@ -433,7 +417,7 @@
SBCommandInterpreter::GetDebugger ()
{
SBDebugger sb_debugger;
- if (m_opaque_ptr)
+ if (IsValid())
sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -448,15 +432,13 @@
bool
SBCommandInterpreter::GetPromptOnQuit()
{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetPromptOnQuit();
- return false;
+ return (IsValid() ? m_opaque_ptr->GetPromptOnQuit() : false);
}
void
SBCommandInterpreter::SetPromptOnQuit (bool b)
{
- if (m_opaque_ptr)
+ if (IsValid())
m_opaque_ptr->SetPromptOnQuit(b);
}
@@ -464,7 +446,7 @@
SBCommandInterpreter::ResolveCommand(const char *command_line, SBCommandReturnObject &result)
{
result.Clear();
- if (command_line && m_opaque_ptr)
+ if (command_line && IsValid())
{
m_opaque_ptr->ResolveCommand(command_line, result.ref());
}
@@ -475,7 +457,6 @@
}
}
-
CommandInterpreter *
SBCommandInterpreter::get ()
{
@@ -499,7 +480,7 @@
SBCommandInterpreter::SourceInitFileInHomeDirectory (SBCommandReturnObject &result)
{
result.Clear();
- if (m_opaque_ptr)
+ if (IsValid())
{
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
Mutex::Locker api_locker;
@@ -524,7 +505,7 @@
SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory (SBCommandReturnObject &result)
{
result.Clear();
- if (m_opaque_ptr)
+ if (IsValid())
{
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
Mutex::Locker api_locker;
@@ -588,7 +569,7 @@
lldb::CommandOverrideCallback callback,
void *baton)
{
- if (command_name && command_name[0] && m_opaque_ptr)
+ if (command_name && command_name[0] && IsValid())
{
std::string command_name_str (command_name);
CommandObject *cmd_obj = m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
@@ -605,7 +586,7 @@
lldb::SBCommand
SBCommandInterpreter::AddMultiwordCommand (const char* name, const char* help)
{
- CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr,name,help);
+ CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr, name, help);
new_command->SetRemovable (true);
lldb::CommandObjectSP new_command_sp(new_command);
if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
@@ -617,47 +598,40 @@
SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help)
{
lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name,impl,help));
+ new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name, impl, help));
if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
return lldb::SBCommand(new_command_sp);
return lldb::SBCommand();
}
-SBCommand::SBCommand ()
-{}
+SBCommand::SBCommand() = default;
SBCommand::SBCommand (lldb::CommandObjectSP cmd_sp) : m_opaque_sp (cmd_sp)
{}
bool
-SBCommand::IsValid ()
+SBCommand::IsValid()
{
- return (bool)m_opaque_sp;
+ return m_opaque_sp.get() != nullptr;
}
const char*
-SBCommand::GetName ()
+SBCommand::GetName()
{
- if (IsValid ())
- return m_opaque_sp->GetCommandName ();
- return NULL;
+ return (IsValid() ? m_opaque_sp->GetCommandName() : nullptr);
}
const char*
-SBCommand::GetHelp ()
+SBCommand::GetHelp()
{
- if (IsValid ())
- return m_opaque_sp->GetHelp ();
- return NULL;
+ return (IsValid() ? m_opaque_sp->GetHelp() : nullptr);
}
const char*
-SBCommand::GetHelpLong ()
+SBCommand::GetHelpLong()
{
- if (IsValid ())
- return m_opaque_sp->GetHelpLong ();
- return NULL;
+ return (IsValid() ? m_opaque_sp->GetHelpLong() : nullptr);
}
void
@@ -679,7 +653,7 @@
{
if (!IsValid ())
return lldb::SBCommand();
- if (m_opaque_sp->IsMultiwordObject() == false)
+ if (!m_opaque_sp->IsMultiwordObject())
return lldb::SBCommand();
CommandObjectMultiword *new_command = new CommandObjectMultiword(m_opaque_sp->GetCommandInterpreter(),name,help);
new_command->SetRemovable (true);
@@ -694,7 +668,7 @@
{
if (!IsValid ())
return lldb::SBCommand();
- if (m_opaque_sp->IsMultiwordObject() == false)
+ if (!m_opaque_sp->IsMultiwordObject())
return lldb::SBCommand();
lldb::CommandObjectSP new_command_sp;
new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help));
@@ -706,9 +680,7 @@
uint32_t
SBCommand::GetFlags ()
{
- if (!IsValid())
- return 0;
- return m_opaque_sp->GetFlags().Get();
+ return (IsValid() ? m_opaque_sp->GetFlags().Get() : 0);
}
void
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index 1ae2df7..a2ed4d6 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBStream.h"
@@ -26,7 +30,7 @@
SBCommandReturnObject::SBCommandReturnObject (const SBCommandReturnObject &rhs):
m_opaque_ap ()
{
- if (rhs.m_opaque_ap.get())
+ if (rhs.m_opaque_ap)
m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
}
@@ -35,6 +39,8 @@
{
}
+SBCommandReturnObject::~SBCommandReturnObject() = default;
+
CommandReturnObject *
SBCommandReturnObject::Release ()
{
@@ -46,7 +52,7 @@
{
if (this != &rhs)
{
- if (rhs.m_opaque_ap.get())
+ if (rhs.m_opaque_ap)
m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
else
m_opaque_ap.reset();
@@ -54,25 +60,18 @@
return *this;
}
-
-SBCommandReturnObject::~SBCommandReturnObject ()
-{
- // m_opaque_ap will automatically delete any pointer it owns
-}
-
bool
SBCommandReturnObject::IsValid() const
{
- return m_opaque_ap.get() != NULL;
+ return m_opaque_ap.get() != nullptr;
}
-
const char *
SBCommandReturnObject::GetOutput ()
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
if (log)
log->Printf ("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
@@ -83,10 +82,10 @@
}
if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetOutput () => NULL",
+ log->Printf ("SBCommandReturnObject(%p)::GetOutput () => nullptr",
static_cast<void*>(m_opaque_ap.get()));
- return NULL;
+ return nullptr;
}
const char *
@@ -94,7 +93,7 @@
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
if (log)
log->Printf ("SBCommandReturnObject(%p)::GetError () => \"%s\"",
@@ -105,26 +104,22 @@
}
if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetError () => NULL",
+ log->Printf ("SBCommandReturnObject(%p)::GetError () => nullptr",
static_cast<void*>(m_opaque_ap.get()));
- return NULL;
+ return nullptr;
}
size_t
-SBCommandReturnObject::GetOutputSize ()
+SBCommandReturnObject::GetOutputSize()
{
- if (m_opaque_ap.get())
- return strlen (m_opaque_ap->GetOutputData());
- return 0;
+ return (m_opaque_ap ? strlen(m_opaque_ap->GetOutputData()) : 0);
}
size_t
-SBCommandReturnObject::GetErrorSize ()
+SBCommandReturnObject::GetErrorSize()
{
- if (m_opaque_ap.get())
- return strlen(m_opaque_ap->GetErrorData());
- return 0;
+ return (m_opaque_ap ? strlen(m_opaque_ap->GetErrorData()) : 0);
}
size_t
@@ -154,52 +149,46 @@
void
SBCommandReturnObject::Clear()
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->Clear();
}
lldb::ReturnStatus
SBCommandReturnObject::GetStatus()
{
- if (m_opaque_ap.get())
- return m_opaque_ap->GetStatus();
- return lldb::eReturnStatusInvalid;
+ return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
}
void
SBCommandReturnObject::SetStatus(lldb::ReturnStatus status)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->SetStatus(status);
}
bool
-SBCommandReturnObject::Succeeded ()
+SBCommandReturnObject::Succeeded()
{
- if (m_opaque_ap.get())
- return m_opaque_ap->Succeeded();
- return false;
+ return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
}
bool
-SBCommandReturnObject::HasResult ()
+SBCommandReturnObject::HasResult()
{
- if (m_opaque_ap.get())
- return m_opaque_ap->HasResult();
- return false;
+ return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
}
void
SBCommandReturnObject::AppendMessage (const char *message)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->AppendMessage (message);
}
void
SBCommandReturnObject::AppendWarning (const char *message)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->AppendWarning (message);
}
@@ -222,7 +211,6 @@
return *(m_opaque_ap.get());
}
-
CommandReturnObject &
SBCommandReturnObject::ref() const
{
@@ -230,11 +218,10 @@
return *(m_opaque_ap.get());
}
-
void
SBCommandReturnObject::SetLLDBObjectPtr (CommandReturnObject *ptr)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap.reset (ptr);
}
@@ -243,7 +230,7 @@
{
Stream &strm = description.ref();
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
description.Printf ("Status: ");
lldb::ReturnStatus status = m_opaque_ap->GetStatus();
@@ -269,25 +256,25 @@
}
void
-SBCommandReturnObject::SetImmediateOutputFile (FILE *fh)
+SBCommandReturnObject::SetImmediateOutputFile(FILE *fh)
{
- if (m_opaque_ap.get())
- m_opaque_ap->SetImmediateOutputFile (fh);
+ if (m_opaque_ap)
+ m_opaque_ap->SetImmediateOutputFile(fh);
}
void
-SBCommandReturnObject::SetImmediateErrorFile (FILE *fh)
+SBCommandReturnObject::SetImmediateErrorFile(FILE *fh)
{
- if (m_opaque_ap.get())
- m_opaque_ap->SetImmediateErrorFile (fh);
+ if (m_opaque_ap)
+ m_opaque_ap->SetImmediateErrorFile(fh);
}
void
SBCommandReturnObject::PutCString(const char* string, int len)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
- if (len == 0 || string == NULL || *string == 0)
+ if (len == 0 || string == nullptr || *string == 0)
{
return;
}
@@ -304,27 +291,27 @@
const char *
SBCommandReturnObject::GetOutput (bool only_if_no_immediate)
{
- if (!m_opaque_ap.get())
- return NULL;
- if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL)
+ if (!m_opaque_ap)
+ return nullptr;
+ if (!only_if_no_immediate || m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
return GetOutput();
- return NULL;
+ return nullptr;
}
const char *
SBCommandReturnObject::GetError (bool only_if_no_immediate)
{
- if (!m_opaque_ap.get())
- return NULL;
- if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL)
+ if (!m_opaque_ap)
+ return nullptr;
+ if (!only_if_no_immediate || m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
return GetError();
- return NULL;
+ return nullptr;
}
size_t
SBCommandReturnObject::Printf(const char* format, ...)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
va_list args;
va_start (args, format);
@@ -338,7 +325,7 @@
void
SBCommandReturnObject::SetError (lldb::SBError &error, const char *fallback_error_cstr)
{
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
{
if (error.IsValid())
m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
@@ -350,7 +337,6 @@
void
SBCommandReturnObject::SetError (const char *error_cstr)
{
- if (m_opaque_ap.get() && error_cstr)
+ if (m_opaque_ap && error_cstr)
m_opaque_ap->SetError(error_cstr);
}
-
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 53785cd..49eeab2 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/API/SBDebugger.h"
#include "lldb/lldb-private.h"
@@ -50,7 +54,6 @@
using namespace lldb;
using namespace lldb_private;
-
static llvm::sys::DynamicLibrary
LoadPlugin (const lldb::DebuggerSP &debugger_sp, const FileSpec& spec, Error& error)
{
@@ -87,13 +90,6 @@
static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;
-SBInputReader::SBInputReader()
-{
-}
-SBInputReader::~SBInputReader()
-{
-}
-
SBError
SBInputReader::Initialize(lldb::SBDebugger &sb_debugger,
unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction, char const *,
@@ -107,12 +103,37 @@
SBInputReader::SetIsDone(bool)
{
}
+
bool
SBInputReader::IsActive() const
{
return false;
}
+SBDebugger::SBDebugger() = default;
+
+SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp) :
+ m_opaque_sp(debugger_sp)
+{
+}
+
+SBDebugger::SBDebugger(const SBDebugger &rhs) :
+ m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+SBDebugger::~SBDebugger() = default;
+
+SBDebugger &
+SBDebugger::operator = (const SBDebugger &rhs)
+{
+ if (this != &rhs)
+ {
+ m_opaque_sp = rhs.m_opaque_sp;
+ }
+ return *this;
+}
+
void
SBDebugger::Initialize ()
{
@@ -148,13 +169,13 @@
SBDebugger
SBDebugger::Create()
{
- return SBDebugger::Create(false, NULL, NULL);
+ return SBDebugger::Create(false, nullptr, nullptr);
}
SBDebugger
SBDebugger::Create(bool source_init_files)
{
- return SBDebugger::Create (source_init_files, NULL, NULL);
+ return SBDebugger::Create (source_init_files, nullptr, nullptr);
}
SBDebugger
@@ -216,7 +237,7 @@
Debugger::Destroy (debugger.m_opaque_sp);
- if (debugger.m_opaque_sp.get() != NULL)
+ if (debugger.m_opaque_sp.get() != nullptr)
debugger.m_opaque_sp.reset();
}
@@ -238,42 +259,12 @@
ModuleList::RemoveOrphanSharedModules(mandatory);
}
-SBDebugger::SBDebugger () :
- m_opaque_sp ()
-{
-}
-
-SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp) :
- m_opaque_sp(debugger_sp)
-{
-}
-
-SBDebugger::SBDebugger(const SBDebugger &rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-SBDebugger &
-SBDebugger::operator = (const SBDebugger &rhs)
-{
- if (this != &rhs)
- {
- m_opaque_sp = rhs.m_opaque_sp;
- }
- return *this;
-}
-
-SBDebugger::~SBDebugger ()
-{
-}
-
bool
SBDebugger::IsValid() const
{
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
-
void
SBDebugger::SetAsync (bool b)
{
@@ -282,12 +273,9 @@
}
bool
-SBDebugger::GetAsync ()
+SBDebugger::GetAsync()
{
- if (m_opaque_sp)
- return m_opaque_sp->GetAsyncExecution();
- else
- return false;
+ return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
}
void
@@ -359,7 +347,7 @@
if (stream_file_sp)
return stream_file_sp->GetFile().GetStream();
}
- return NULL;
+ return nullptr;
}
FILE *
@@ -371,20 +359,19 @@
if (stream_file_sp)
return stream_file_sp->GetFile().GetStream();
}
- return NULL;
+ return nullptr;
}
FILE *
SBDebugger::GetErrorFileHandle ()
{
if (m_opaque_sp)
- if (m_opaque_sp)
- {
- StreamFileSP stream_file_sp (m_opaque_sp->GetErrorFile());
- if (stream_file_sp)
- return stream_file_sp->GetFile().GetStream();
- }
- return NULL;
+ {
+ StreamFileSP stream_file_sp(m_opaque_sp->GetErrorFile());
+ if (stream_file_sp)
+ return stream_file_sp->GetFile().GetStream();
+ }
+ return nullptr;
}
void
@@ -433,12 +420,12 @@
sb_interpreter.HandleCommand (command, result, false);
- if (GetErrorFileHandle() != NULL)
+ if (GetErrorFileHandle() != nullptr)
result.PutError (GetErrorFileHandle());
- if (GetOutputFileHandle() != NULL)
+ if (GetOutputFileHandle() != nullptr)
result.PutOutput (GetOutputFileHandle());
- if (m_opaque_sp->GetAsyncExecution() == false)
+ if (!m_opaque_sp->GetAsyncExecution())
{
SBProcess process(GetCommandInterpreter().GetProcess ());
ProcessSP process_sp (process.GetSP());
@@ -493,7 +480,7 @@
{
// Drain stdout when we stop just in case we have any bytes
while ((len = process.GetSTDOUT (stdio_buffer, sizeof (stdio_buffer))) > 0)
- if (out != NULL)
+ if (out != nullptr)
::fwrite (stdio_buffer, 1, len, out);
}
@@ -501,7 +488,7 @@
{
// Drain stderr when we stop just in case we have any bytes
while ((len = process.GetSTDERR (stdio_buffer, sizeof (stdio_buffer))) > 0)
- if (err != NULL)
+ if (err != nullptr)
::fwrite (stdio_buffer, 1, len, err);
}
@@ -525,7 +512,6 @@
return sb_source_manager;
}
-
bool
SBDebugger::GetDefaultArchitecture (char *arch_name, size_t arch_name_len)
{
@@ -548,7 +534,6 @@
return false;
}
-
bool
SBDebugger::SetDefaultArchitecture (const char *arch_name)
{
@@ -565,12 +550,11 @@
}
ScriptLanguage
-SBDebugger::GetScriptingLanguage (const char *script_language_name)
+SBDebugger::GetScriptingLanguage(const char *script_language_name)
{
-
- return Args::StringToScriptLanguage (script_language_name,
- eScriptLanguageDefault,
- NULL);
+ return Args::StringToScriptLanguage(script_language_name,
+ eScriptLanguageDefault,
+ nullptr);
}
const char *
@@ -660,12 +644,12 @@
if (m_opaque_sp)
{
const bool add_dependent_modules = true;
- Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
- filename,
- target_triple,
- add_dependent_modules,
- NULL,
- target_sp));
+ Error error (m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
+ filename,
+ target_triple,
+ add_dependent_modules,
+ nullptr,
+ target_sp));
sb_target.SetSP (target_sp);
}
@@ -690,12 +674,12 @@
Error error;
const bool add_dependent_modules = true;
- error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
- filename,
- arch_cstr,
- add_dependent_modules,
- NULL,
- target_sp);
+ error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
+ filename,
+ arch_cstr,
+ add_dependent_modules,
+ nullptr,
+ target_sp);
if (error.Success())
{
@@ -721,12 +705,12 @@
{
Error error;
const bool add_dependent_modules = true;
- error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
- filename,
- NULL,
- add_dependent_modules,
- NULL,
- target_sp);
+ error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
+ filename,
+ nullptr,
+ add_dependent_modules,
+ nullptr,
+ target_sp);
if (error.Success())
{
@@ -768,6 +752,7 @@
return result;
}
+
SBTarget
SBDebugger::GetTargetAtIndex (uint32_t idx)
{
@@ -814,7 +799,7 @@
{
// No need to lock, the target list is thread safe
ArchSpec arch (arch_name, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get());
- TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture (FileSpec(filename, false), arch_name ? &arch : NULL));
+ TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(FileSpec(filename, false), arch_name ? &arch : nullptr));
sb_target.SetSP (target_sp);
}
return sb_target;
@@ -832,7 +817,6 @@
return sb_target;
}
-
uint32_t
SBDebugger::GetNumTargets ()
{
@@ -1051,10 +1035,7 @@
const char *
SBDebugger::GetInstanceName()
{
- if (m_opaque_sp)
- return m_opaque_sp->GetInstanceName().AsCString();
- else
- return NULL;
+ return (m_opaque_sp ? m_opaque_sp->GetInstanceName().AsCString() : nullptr);
}
SBError
@@ -1110,11 +1091,9 @@
}
uint32_t
-SBDebugger::GetTerminalWidth () const
+SBDebugger::GetTerminalWidth() const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetTerminalWidth ();
- return 0;
+ return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
}
void
@@ -1134,9 +1113,7 @@
static_cast<void*>(m_opaque_sp.get()),
(m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
- if (m_opaque_sp)
- return m_opaque_sp->GetPrompt ();
- return 0;
+ return (m_opaque_sp ? m_opaque_sp->GetPrompt() : nullptr);
}
void
@@ -1145,14 +1122,11 @@
if (m_opaque_sp)
m_opaque_sp->SetPrompt (prompt);
}
-
ScriptLanguage
SBDebugger::GetScriptLanguage() const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetScriptLanguage ();
- return eScriptLanguageNone;
+ return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
}
void
@@ -1165,35 +1139,27 @@
}
bool
-SBDebugger::SetUseExternalEditor (bool value)
+SBDebugger::SetUseExternalEditor(bool value)
{
- if (m_opaque_sp)
- return m_opaque_sp->SetUseExternalEditor (value);
- return false;
+ return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
}
bool
-SBDebugger::GetUseExternalEditor ()
+SBDebugger::GetUseExternalEditor()
{
- if (m_opaque_sp)
- return m_opaque_sp->GetUseExternalEditor ();
- return false;
+ return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
}
bool
-SBDebugger::SetUseColor (bool value)
+SBDebugger::SetUseColor(bool value)
{
- if (m_opaque_sp)
- return m_opaque_sp->SetUseColor (value);
- return false;
+ return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
}
bool
-SBDebugger::GetUseColor () const
+SBDebugger::GetUseColor() const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetUseColor ();
- return false;
+ return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
}
bool
@@ -1216,12 +1182,9 @@
user_id_t
SBDebugger::GetID()
{
- if (m_opaque_sp)
- return m_opaque_sp->GetID();
- return LLDB_INVALID_UID;
+ return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
}
-
SBError
SBDebugger::SetCurrentPlatform (const char *platform_name_cstr)
{
@@ -1279,11 +1242,9 @@
}
bool
-SBDebugger::GetCloseInputOnEOF () const
+SBDebugger::GetCloseInputOnEOF() const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetCloseInputOnEOF ();
- return false;
+ return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false);
}
void
@@ -1361,7 +1322,7 @@
SBTypeSummary
SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name)
{
- if (type_name.IsValid() == false)
+ if (!type_name.IsValid())
return SBTypeSummary();
return SBTypeSummary(DataVisualization::GetSummaryForType(type_name.GetSP()));
}
@@ -1370,7 +1331,7 @@
SBTypeFilter
SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name)
{
- if (type_name.IsValid() == false)
+ if (!type_name.IsValid())
return SBTypeFilter();
return SBTypeFilter(DataVisualization::GetFilterForType(type_name.GetSP()));
}
@@ -1379,7 +1340,7 @@
SBTypeSynthetic
SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
{
- if (type_name.IsValid() == false)
+ if (!type_name.IsValid())
return SBTypeSynthetic();
return SBTypeSynthetic(DataVisualization::GetSyntheticForType(type_name.GetSP()));
}
@@ -1392,8 +1353,7 @@
{
uint32_t log_options = LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME;
StreamString errors;
- return m_opaque_sp->EnableLog (channel, categories, NULL, log_options, errors);
-
+ return m_opaque_sp->EnableLog(channel, categories, nullptr, log_options, errors);
}
else
return false;
@@ -1407,5 +1367,3 @@
return m_opaque_sp->SetLoggingCallback (log_callback, baton);
}
}
-
-
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 57572f8..02664ff 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -7,10 +7,14 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/API/SBFrame.h"
-
-#include <string>
+// C Includes
+// C++ Includes
#include <algorithm>
+#include <string>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/API/SBFrame.h"
#include "lldb/lldb-types.h"
@@ -50,7 +54,6 @@
using namespace lldb;
using namespace lldb_private;
-
SBFrame::SBFrame () :
m_opaque_sp (new ExecutionContextRef())
{
@@ -76,6 +79,8 @@
{
}
+SBFrame::~SBFrame() = default;
+
const SBFrame &
SBFrame::operator = (const SBFrame &rhs)
{
@@ -84,16 +89,10 @@
return *this;
}
-SBFrame::~SBFrame()
-{
-}
-
StackFrameSP
SBFrame::GetFrameSP() const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetFrameSP();
- return StackFrameSP();
+ return (m_opaque_sp ? m_opaque_sp->GetFrameSP() : StackFrameSP());
}
void
@@ -105,7 +104,7 @@
bool
SBFrame::IsValid() const
{
- return GetFrameSP().get() != NULL;
+ return GetFrameSP().get() != nullptr;
}
SBSymbolContext
@@ -116,7 +115,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -159,7 +158,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -202,7 +201,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -243,7 +242,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -284,7 +283,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -324,7 +323,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -364,7 +363,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
Process *process = exe_ctx.GetProcessPtr();
@@ -405,7 +404,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -464,7 +463,6 @@
return LLDB_INVALID_ADDRESS;
}
-
addr_t
SBFrame::GetPC () const
{
@@ -473,7 +471,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -514,7 +512,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -555,7 +553,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -587,7 +585,6 @@
return addr;
}
-
addr_t
SBFrame::GetFP () const
{
@@ -596,7 +593,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -628,7 +625,6 @@
return addr;
}
-
SBAddress
SBFrame::GetPCAddress () const
{
@@ -696,7 +692,7 @@
SBValue sb_value;
Mutex::Locker api_locker;
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (var_path == NULL || var_path[0] == '\0')
+ if (var_path == nullptr || var_path[0] == '\0')
{
if (log)
log->Printf ("SBFrame::GetValueForVariablePath called with empty variable path.");
@@ -705,7 +701,7 @@
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -762,7 +758,7 @@
VariableSP var_sp;
SBValue sb_value;
- if (name == NULL || name[0] == '\0')
+ if (name == nullptr || name[0] == '\0')
{
if (log)
log->Printf ("SBFrame::FindVariable called with empty name");
@@ -773,7 +769,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -850,7 +846,7 @@
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBValue sb_value;
- if (name == NULL || name[0] == '\0')
+ if (name == nullptr || name[0] == '\0')
{
if (log)
log->Printf ("SBFrame::FindValue called with empty name.");
@@ -861,7 +857,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1035,11 +1031,11 @@
SBFrame::Disassemble () const
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- const char *disassembly = NULL;
+ const char *disassembly = nullptr;
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1072,7 +1068,6 @@
return disassembly;
}
-
SBValueList
SBFrame::GetVariables (bool arguments,
bool locals,
@@ -1130,7 +1125,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
const bool statics = options.GetIncludeStatics();
@@ -1156,7 +1151,7 @@
if (frame)
{
size_t i;
- VariableList *variable_list = NULL;
+ VariableList *variable_list = nullptr;
variable_list = frame->GetVariableList(true);
if (variable_list)
{
@@ -1194,9 +1189,9 @@
ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
- if (false == include_runtime_support_values &&
- valobj_sp &&
- true == valobj_sp->IsRuntimeSupportValue())
+ if (!include_runtime_support_values &&
+ valobj_sp != nullptr &&
+ valobj_sp->IsRuntimeSupportValue())
continue;
SBValue value_sb;
@@ -1238,7 +1233,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1290,7 +1285,7 @@
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1427,7 +1422,7 @@
ExpressionResults exe_results = eExpressionSetupError;
SBValue expr_result;
- if (expr == NULL || expr[0] == '\0')
+ if (expr == nullptr || expr[0] == '\0')
{
if (log)
log->Printf ("SBFrame::EvaluateExpression called with an empty expression");
@@ -1442,7 +1437,7 @@
if (log)
log->Printf ("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
@@ -1469,7 +1464,7 @@
expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
if (target->GetDisplayExpressionsInCrashlogs())
- Host::SetCrashDescription (NULL);
+ Host::SetCrashDescription(nullptr);
}
else
{
@@ -1509,7 +1504,7 @@
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
ExecutionContext exe_ctx(m_opaque_sp.get());
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1523,7 +1518,7 @@
Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
if (block)
- return block->GetContainingInlinedBlock () != NULL;
+ return block->GetContainingInlinedBlock() != nullptr;
}
else
{
@@ -1551,9 +1546,9 @@
SBFrame::GetFunctionName() const
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- const char *name = NULL;
+ const char *name = nullptr;
ExecutionContext exe_ctx(m_opaque_sp.get());
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1575,13 +1570,13 @@
}
}
- if (name == NULL)
+ if (name == nullptr)
{
if (sc.function)
name = sc.function->GetName().GetCString();
}
- if (name == NULL)
+ if (name == nullptr)
{
if (sc.symbol)
name = sc.symbol->GetName().GetCString();
@@ -1607,9 +1602,9 @@
SBFrame::GetDisplayFunctionName()
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- const char *name = NULL;
+ const char *name = nullptr;
ExecutionContext exe_ctx(m_opaque_sp.get());
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
@@ -1631,13 +1626,13 @@
}
}
- if (name == NULL)
+ if (name == nullptr)
{
if (sc.function)
name = sc.function->GetDisplayName().GetCString();
}
- if (name == NULL)
+ if (name == nullptr)
{
if (sc.symbol)
name = sc.symbol->GetDisplayName().GetCString();