//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/ProcessInfo.h"
-
// C Includes
-#include <limits.h>
+// C++ Includes
+#include <climits>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/ProcessInfo.h"
using namespace lldb;
using namespace lldb_private;
const char *
ProcessInfo::GetArg0 () const
{
- if (m_arg0.empty())
- return NULL;
- return m_arg0.c_str();
+ return (m_arg0.empty() ? nullptr : m_arg0.c_str());
}
void
}
}
}
+
void
ProcessInfo::SetArguments (const Args& args, bool first_arg_is_executable)
{
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/Target/Process.h"
#include "lldb/Target/Queue.h"
#include "lldb/Target/QueueList.h"
m_process_wp = process_sp;
}
-Queue::~Queue ()
-{
-}
+Queue::~Queue() = default;
queue_id_t
Queue::GetID ()
const char *
Queue::GetName ()
{
- const char *result = NULL;
- if (m_queue_name.size() > 0)
- result = m_queue_name.c_str();
- return result;
+ return (m_queue_name.empty() ? nullptr : m_queue_name.c_str());
}
uint32_t
{
std::vector<ThreadSP> result;
ProcessSP process_sp = m_process_wp.lock();
- if (process_sp.get ())
+ if (process_sp)
{
for (ThreadSP thread_sp : process_sp->Threads())
{
return m_running_work_items_count;
}
-
void
Queue::SetNumPendingWorkItems (uint32_t count)
{
return m_dispatch_queue_t_addr;
}
-
const std::vector<lldb::QueueItemSP> &
Queue::GetPendingItems ()
{
- if (m_pending_items.size() == 0)
+ if (m_pending_items.empty())
{
ProcessSP process_sp = m_process_wp.lock();
if (process_sp && process_sp->GetSystemRuntime())
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/StackFrame.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Target/StackFrame.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
m_reg_context_sp (),
- m_id (pc, cfa, NULL),
+ m_id(pc, cfa, nullptr),
m_frame_code_addr (pc),
m_sc (),
m_flags (),
{
// If we don't have a CFA value, use the frame index for our StackID so that recursive
// functions properly aren't confused with one another on a history stack.
- if (m_is_history_frame && m_cfa_is_valid == false)
+ if (m_is_history_frame && !m_cfa_is_valid)
{
m_id.SetCFA (m_frame_index);
}
- if (sc_ptr != NULL)
+ if (sc_ptr != nullptr)
{
m_sc = *sc_ptr;
m_flags.Set(m_sc.GetResolvedMask ());
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
m_reg_context_sp (reg_context_sp),
- m_id (pc, cfa, NULL),
+ m_id(pc, cfa, nullptr),
m_frame_code_addr (pc),
m_sc (),
m_flags (),
m_disassembly (),
m_mutex (Mutex::eMutexTypeRecursive)
{
- if (sc_ptr != NULL)
+ if (sc_ptr != nullptr)
{
m_sc = *sc_ptr;
m_flags.Set(m_sc.GetResolvedMask ());
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
m_reg_context_sp (reg_context_sp),
- m_id (pc_addr.GetLoadAddress (thread_sp->CalculateTarget().get()), cfa, NULL),
+ m_id(pc_addr.GetLoadAddress(thread_sp->CalculateTarget().get()), cfa, nullptr),
m_frame_code_addr (pc_addr),
m_sc (),
m_flags (),
m_disassembly (),
m_mutex (Mutex::eMutexTypeRecursive)
{
- if (sc_ptr != NULL)
+ if (sc_ptr != nullptr)
{
m_sc = *sc_ptr;
m_flags.Set(m_sc.GetResolvedMask ());
}
- if (m_sc.target_sp.get() == NULL && reg_context_sp)
+ if (!m_sc.target_sp && reg_context_sp)
{
m_sc.target_sp = reg_context_sp->CalculateTarget();
if (m_sc.target_sp)
}
}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-StackFrame::~StackFrame()
-{
-}
+StackFrame::~StackFrame() = default;
StackID&
StackFrame::GetStackID()
// Calculate the frame block and use this for the stack ID symbol
// context scope if we have one.
SymbolContextScope *scope = GetFrameBlock ();
- if (scope == NULL)
+ if (scope == nullptr)
{
// We don't have a block, so use the symbol
if (m_flags.IsClear (eSymbolContextSymbol))
GetSymbolContext (eSymbolContextSymbol);
- // It is ok if m_sc.symbol is NULL here
+ // It is ok if m_sc.symbol is nullptr here
scope = m_sc.symbol;
}
// Set the symbol context scope (the accessor will set the
Target *target = exe_ctx.GetTargetPtr();
if (target)
{
- const char *plugin_name = NULL;
- const char *flavor = NULL;
+ const char *plugin_name = nullptr;
+ const char *flavor = nullptr;
Disassembler::Disassemble (target->GetDebugger(),
target->GetArchitecture(),
plugin_name,
m_disassembly);
}
if (m_disassembly.GetSize() == 0)
- return NULL;
+ return nullptr;
}
return m_disassembly.GetData();
}
Block *
StackFrame::GetFrameBlock ()
{
- if (m_sc.block == NULL && m_flags.IsClear (eSymbolContextBlock))
+ if (m_sc.block == nullptr && m_flags.IsClear(eSymbolContextBlock))
GetSymbolContext (eSymbolContextBlock);
if (m_sc.block)
return &m_sc.function->GetBlock (false);
}
}
- return NULL;
+ return nullptr;
}
//----------------------------------------------------------------------
resolved |= eSymbolContextTarget;
}
-
// Resolve our PC to section offset if we haven't already done so
// and if we don't have a module. The resolved address section will
// contain the module to which it belongs
}
}
-
if (m_sc.module_sp)
{
// We have something in our stack frame symbol context, lets check
// Only replace what we didn't already have as we may have
// information for an inlined function scope that won't match
// what a standard lookup by address would match
- if ((resolved & eSymbolContextCompUnit) && m_sc.comp_unit == NULL)
+ if ((resolved & eSymbolContextCompUnit) && m_sc.comp_unit == nullptr)
m_sc.comp_unit = sc.comp_unit;
- if ((resolved & eSymbolContextFunction) && m_sc.function == NULL)
+ if ((resolved & eSymbolContextFunction) && m_sc.function == nullptr)
m_sc.function = sc.function;
- if ((resolved & eSymbolContextBlock) && m_sc.block == NULL)
+ if ((resolved & eSymbolContextBlock) && m_sc.block == nullptr)
m_sc.block = sc.block;
- if ((resolved & eSymbolContextSymbol) && m_sc.symbol == NULL)
+ if ((resolved & eSymbolContextSymbol) && m_sc.symbol == nullptr)
m_sc.symbol = sc.symbol;
if ((resolved & eSymbolContextLineEntry) && !m_sc.line_entry.IsValid())
{
return m_sc;
}
-
VariableList *
StackFrame::GetVariableList (bool get_file_globals)
{
return var_list_sp;
}
-
ValueObjectSP
StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr,
DynamicValueType use_dynamic,
const char separator_type = var_path[0];
switch (separator_type)
{
-
case '-':
if (var_path.size() >= 2 && var_path[1] != '>')
return ValueObjectSP();
{
// Make sure we aren't trying to deref an objective
// C ivar if this is not allowed
- const uint32_t pointer_type_flags = valobj_sp->GetCompilerType().GetTypeInfo (NULL);
+ const uint32_t pointer_type_flags = valobj_sp->GetCompilerType().GetTypeInfo(nullptr);
if ((pointer_type_flags & eTypeIsObjC) &&
(pointer_type_flags & eTypeIsPointer))
{
child_valobj_sp = valobj_sp->GetChildMemberWithName (child_name, true);
if (!child_valobj_sp)
{
- if (no_synth_child == false)
+ if (!no_synth_child)
{
child_valobj_sp = valobj_sp->GetSyntheticValue();
if (child_valobj_sp)
// Array member access, or treating pointer as an array
if (var_path.size() > 2) // Need at least two brackets and a number
{
- char *end = NULL;
+ char *end = nullptr;
long child_index = ::strtol (&var_path[1], &end, 0);
if (end && *end == ']'
&& *(end-1) != '[') // this code forces an error in the case of arr[]. as bitfield[] is not a good syntax we're good to go
{
// dereferencing ObjC variables is not valid.. so let's try and recur to synthetic children
ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();
- if (synthetic.get() == NULL /* no synthetic */
+ if (!synthetic /* no synthetic */
|| synthetic == valobj_sp) /* synthetic is the same as the original object */
{
valobj_sp->GetExpressionPath (var_expr_path_strm, false);
}
}
}
- else if (valobj_sp->GetCompilerType().IsArrayType (NULL, NULL, &is_incomplete_array))
+ else if (valobj_sp->GetCompilerType().IsArrayType(nullptr, nullptr, &is_incomplete_array))
{
// Pass false to dynamic_value here so we can tell the difference between
// no dynamic value and no member of this type...
child_valobj_sp = valobj_sp->GetChildAtIndex (child_index, true);
- if (!child_valobj_sp && (is_incomplete_array || no_synth_child == false))
+ if (!child_valobj_sp && (is_incomplete_array || !no_synth_child))
child_valobj_sp = valobj_sp->GetSyntheticArrayMember (child_index, true);
if (!child_valobj_sp)
{
ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();
if (no_synth_child /* synthetic is forbidden */ ||
- synthetic.get() == NULL /* no synthetic */
+ !synthetic /* no synthetic */
|| synthetic == valobj_sp) /* synthetic is the same as the original object */
{
valobj_sp->GetExpressionPath (var_expr_path_strm, false);
else if (end && *end == '-')
{
// this is most probably a BitField, let's take a look
- char *real_end = NULL;
+ char *real_end = nullptr;
long final_index = ::strtol (end+1, &real_end, 0);
bool expand_bitfield = true;
if (real_end && *real_end == ']')
if (var_path.empty())
break;
-
}
if (valobj_sp)
{
StackFrame::GetFrameBaseValue (Scalar &frame_base, Error *error_ptr)
{
Mutex::Locker locker(m_mutex);
- if (m_cfa_is_valid == false)
+ if (!m_cfa_is_valid)
{
m_frame_base_error.SetErrorString("No frame base available for this historical stack frame.");
return false;
if (m_sc.function->GetFrameBaseExpression().IsLocationList())
loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.GetTargetPtr());
- if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
+ if (!m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, nullptr, nullptr, nullptr, loclist_base_addr,
+ nullptr, expr_value, &m_frame_base_error))
{
// We should really have an error if evaluate returns, but in case
// we don't, lets set the error to something at least.
return m_sc.line_entry.IsValid();
}
-
ValueObjectSP
StackFrame::GetValueObjectForFrameVariable (const VariableSP &variable_sp, DynamicValueType use_dynamic)
{
if (var_idx < num_variables)
{
valobj_sp = m_variable_list_value_objects.GetValueObjectAtIndex (var_idx);
- if (valobj_sp.get() == NULL)
+ if (!valobj_sp)
{
if (m_variable_list_value_objects.GetSize() < num_variables)
m_variable_list_value_objects.Resize(num_variables);
// We aren't already tracking this global
VariableList *var_list = GetVariableList (true);
// If this frame has no variables, create a new list
- if (var_list == NULL)
+ if (var_list == nullptr)
m_variable_list_sp.reset (new VariableList());
// Add the global/static variable to this frame
bool
StackFrame::IsInlined ()
{
- if (m_sc.block == NULL)
+ if (m_sc.block == nullptr)
GetSymbolContext (eSymbolContextBlock);
if (m_sc.block)
- return m_sc.block->GetContainingInlinedBlock() != NULL;
+ return m_sc.block->GetContainingInlinedBlock() != nullptr;
return false;
}
return shared_from_this();
}
-
void
StackFrame::CalculateExecutionContext (ExecutionContext &exe_ctx)
{
void
StackFrame::DumpUsingSettingsFormat (Stream *strm, const char *frame_marker)
{
- if (strm == NULL)
+ if (strm == nullptr)
return;
GetSymbolContext(eSymbolContextEverything);
if (frame_marker)
s.PutCString(frame_marker);
- const FormatEntity::Entry *frame_format = NULL;
+ const FormatEntity::Entry *frame_format = nullptr;
Target *target = exe_ctx.GetTargetPtr();
if (target)
frame_format = target->GetDebugger().GetFrameFormat();
- if (frame_format && FormatEntity::Format(*frame_format, s, &m_sc, &exe_ctx, NULL, NULL, false, false))
+ if (frame_format && FormatEntity::Format(*frame_format, s, &m_sc, &exe_ctx, nullptr, nullptr, false, false))
{
strm->Write(s.GetData(), s.GetSize());
}
void
StackFrame::Dump (Stream *strm, bool show_frame_index, bool show_fullpaths)
{
- if (strm == NULL)
+ if (strm == nullptr)
return;
if (show_frame_index)
if (!m_disassembly.GetString().empty())
m_disassembly.GetString().swap (m_disassembly.GetString());
}
-
void
StackFrame::UpdatePreviousFrameFromCurrentFrame (StackFrame &curr_frame)
m_concrete_frame_index = curr_frame.m_concrete_frame_index;
m_reg_context_sp = curr_frame.m_reg_context_sp;
m_frame_code_addr = curr_frame.m_frame_code_addr;
- assert (m_sc.target_sp.get() == NULL || curr_frame.m_sc.target_sp.get() == NULL || m_sc.target_sp.get() == curr_frame.m_sc.target_sp.get());
- assert (m_sc.module_sp.get() == NULL || curr_frame.m_sc.module_sp.get() == NULL || m_sc.module_sp.get() == curr_frame.m_sc.module_sp.get());
- assert (m_sc.comp_unit == NULL || curr_frame.m_sc.comp_unit == NULL || m_sc.comp_unit == curr_frame.m_sc.comp_unit);
- assert (m_sc.function == NULL || curr_frame.m_sc.function == NULL || m_sc.function == curr_frame.m_sc.function);
+ assert (!m_sc.target_sp || !curr_frame.m_sc.target_sp || m_sc.target_sp.get() == curr_frame.m_sc.target_sp.get());
+ assert (!m_sc.module_sp || !curr_frame.m_sc.module_sp || m_sc.module_sp.get() == curr_frame.m_sc.module_sp.get());
+ assert (m_sc.comp_unit == nullptr || curr_frame.m_sc.comp_unit == nullptr || m_sc.comp_unit == curr_frame.m_sc.comp_unit);
+ assert (m_sc.function == nullptr || curr_frame.m_sc.function == nullptr || m_sc.function == curr_frame.m_sc.function);
m_sc = curr_frame.m_sc;
m_flags.Clear(GOT_FRAME_BASE | eSymbolContextEverything);
m_flags.Set (m_sc.GetResolvedMask());
m_frame_base_error.Clear();
}
-
bool
StackFrame::HasCachedData () const
{
- if (m_variable_list_sp.get())
+ if (m_variable_list_sp)
return true;
if (m_variable_list_value_objects.GetSize() > 0)
return true;
AddressRange pc_range;
pc_range.GetBaseAddress() = GetFrameCodeAddress();
pc_range.SetByteSize(disasm_lines * target_arch.GetMaximumOpcodeByteSize());
- const char *plugin_name = NULL;
- const char *flavor = NULL;
+ const char *plugin_name = nullptr;
+ const char *flavor = nullptr;
Disassembler::Disassemble (target->GetDebugger(),
target_arch,
plugin_name,
}
return true;
}
-
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/StackFrameList.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Target/StackFrameList.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Core/Log.h"
}
}
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
StackFrameList::~StackFrameList()
{
// Call clear since this takes a lock and clears the stack frame list
if (m_show_inlined_frames)
{
GetFramesUpTo(0);
- if (m_frames.size() == 0)
+ if (m_frames.empty())
return;
if (!m_frames[0]->IsInlined())
{
int num_inlined_functions = 0;
for (Block *container_ptr = block_ptr->GetInlinedParent();
- container_ptr != NULL;
+ container_ptr != nullptr;
container_ptr = container_ptr->GetInlinedParent())
{
if (!container_ptr->GetRangeContainingAddress(pc_as_address, containing_range))
StackFrameList::GetFramesUpTo(uint32_t end_idx)
{
// this makes sure we do not fetch frames for an invalid thread
- if (m_thread.IsValid() == false)
+ if (!m_thread.IsValid())
return;
// We've already gotten more frames than asked for, or we've already finished unwinding, return.
if (reg_ctx_sp)
{
-
const bool success = unwinder && unwinder->GetFrameInfoAtIndex(idx, cfa, pc);
// There shouldn't be any way not to get the frame info for frame 0.
// But if the unwinder can't make one, lets make one by hand with the
pc = reg_ctx_sp->GetPC();
}
- unwind_frame_sp.reset (new StackFrame (m_thread.shared_from_this(),
- m_frames.size(),
- idx,
- reg_ctx_sp,
- cfa,
- pc,
- NULL));
+ unwind_frame_sp.reset(new StackFrame(m_thread.shared_from_this(),
+ m_frames.size(),
+ idx,
+ reg_ctx_sp,
+ cfa,
+ pc,
+ nullptr));
m_frames.push_back (unwind_frame_sp);
}
}
const bool cfa_is_valid = true;
const bool stop_id_is_valid = false;
const bool is_history_frame = false;
- unwind_frame_sp.reset (new StackFrame (m_thread.shared_from_this(), m_frames.size(), idx, cfa, cfa_is_valid, pc, 0, stop_id_is_valid, is_history_frame, NULL));
+ unwind_frame_sp.reset(new StackFrame(m_thread.shared_from_this(), m_frames.size(), idx, cfa, cfa_is_valid, pc,
+ 0, stop_id_is_valid, is_history_frame, nullptr));
m_frames.push_back (unwind_frame_sp);
}
StackFrame *curr_frame = curr_frame_sp.get();
StackFrame *prev_frame = prev_frame_sp.get();
- if (curr_frame == NULL || prev_frame == NULL)
+ if (curr_frame == nullptr || prev_frame == nullptr)
break;
// Check the stack ID to make sure they are equal
void
StackFrameList::Dump (Stream *s)
{
- if (s == NULL)
+ if (s == nullptr)
return;
Mutex::Locker locker (m_mutex);
const bool cfa_is_valid = true;
const bool stop_id_is_valid = false;
const bool is_history_frame = false;
- frame_sp.reset (new StackFrame (m_thread.shared_from_this(), idx, idx, cfa, cfa_is_valid, pc, 0, stop_id_is_valid, is_history_frame, NULL));
+ frame_sp.reset(new StackFrame(m_thread.shared_from_this(), idx, idx, cfa, cfa_is_valid, pc, 0,
+ stop_id_is_valid, is_history_frame, nullptr));
Function *function = frame_sp->GetSymbolContext (eSymbolContextFunction).function;
if (function)
}
else
{
- // Set the symbol scope from the symbol regardless if it is NULL or valid.
+ // Set the symbol scope from the symbol regardless if it is nullptr or valid.
frame_sp->SetSymbolContextScope (frame_sp->GetSymbolContext (eSymbolContextSymbol).symbol);
}
SetFrameAtIndex(idx, frame_sp);
// There should ALWAYS be a frame at index 0. If something went wrong with the CurrentInlinedDepth such that
// there weren't as many frames as we thought taking that into account, then reset the current inlined depth
// and return the real zeroth frame.
- if (m_frames.size() > 0)
- {
- ResetCurrentInlinedDepth();
- frame_sp = m_frames[original_idx];
- }
- else
+ if (m_frames.empty())
{
// Why do we have a thread with zero frames, that should not ever happen...
if (m_thread.IsValid())
assert ("A valid thread has no frames.");
-
+ }
+ else
+ {
+ ResetCurrentInlinedDepth();
+ frame_sp = m_frames[original_idx];
}
}
return m_selected_frame_idx;
}
-
uint32_t
StackFrameList::SetSelectedFrame (lldb_private::StackFrame *frame)
{
void
StackFrameList::Merge (std::unique_ptr<StackFrameList>& curr_ap, lldb::StackFrameListSP& prev_sp)
{
- Mutex::Locker curr_locker (curr_ap.get() ? &curr_ap->m_mutex : NULL);
- Mutex::Locker prev_locker (prev_sp.get() ? &prev_sp->m_mutex : NULL);
+ Mutex::Locker curr_locker(curr_ap ? &curr_ap->m_mutex : nullptr);
+ Mutex::Locker prev_locker(prev_sp ? &prev_sp->m_mutex : nullptr);
#if defined (DEBUG_STACK_FRAMES)
StreamFile s(stdout, false);
s.PutCString("\n\nStackFrameList::Merge():\nPrev:\n");
- if (prev_sp.get())
+ if (prev_sp)
prev_sp->Dump (&s);
else
s.PutCString ("NULL");
s.PutCString("\nCurr:\n");
- if (curr_ap.get())
+ if (curr_ap)
curr_ap->Dump (&s);
else
s.PutCString ("NULL");
s.EOL();
#endif
- if (curr_ap.get() == NULL || curr_ap->GetNumFrames (false) == 0)
+ if (!curr_ap || curr_ap->GetNumFrames(false) == 0)
{
#if defined (DEBUG_STACK_FRAMES)
s.PutCString("No current frames, leave previous frames alone...\n");
return;
}
- if (prev_sp.get() == NULL || prev_sp->GetNumFrames (false) == 0)
+ if (!prev_sp || prev_sp->GetNumFrames(false) == 0)
{
#if defined (DEBUG_STACK_FRAMES)
s.PutCString("No previous frames, so use current frames...\n");
s.PutCString("\nMerged:\n");
prev_sp->Dump (&s);
#endif
-
-
}
lldb::StackFrameSP
last_frame = first_frame + num_frames;
StackFrameSP selected_frame_sp = m_thread.GetSelectedFrame();
- const char *unselected_marker = NULL;
+ const char *unselected_marker = nullptr;
std::string buffer;
if (selected_frame_marker)
{
buffer.insert(buffer.begin(), len, ' ');
unselected_marker = buffer.c_str();
}
- const char *marker = NULL;
+ const char *marker = nullptr;
for (frame_idx = first_frame; frame_idx < last_frame; ++frame_idx)
{
frame_sp = GetFrameAtIndex(frame_idx);
- if (frame_sp.get() == NULL)
+ if (!frame_sp)
break;
- if (selected_frame_marker != NULL)
+ if (selected_frame_marker != nullptr)
{
if (frame_sp == selected_frame_sp)
marker = selected_frame_marker;
strm.IndentLess();
return num_frames_displayed;
}
-
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/StackID.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Target/StackID.h"
#include "lldb/Core/Stream.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Symbol.h"
using namespace lldb_private;
-
void
StackID::Dump (Stream *s)
{
SymbolContextScope *lhs_scope = lhs.GetSymbolContextScope();
SymbolContextScope *rhs_scope = rhs.GetSymbolContextScope();
- // Only compare the PC values if both symbol context scopes are NULL
- if (lhs_scope == NULL && rhs_scope == NULL)
+ // Only compare the PC values if both symbol context scopes are nullptr
+ if (lhs_scope == nullptr && rhs_scope == nullptr)
return lhs.GetPC() == rhs.GetPC();
return lhs_scope == rhs_scope;
SymbolContextScope *lhs_scope = lhs.GetSymbolContextScope();
SymbolContextScope *rhs_scope = rhs.GetSymbolContextScope();
- if (lhs_scope == NULL && rhs_scope == NULL)
+ if (lhs_scope == nullptr && rhs_scope == nullptr)
return lhs.GetPC() != rhs.GetPC();
return lhs_scope != rhs_scope;
SymbolContextScope *lhs_scope = lhs.GetSymbolContextScope();
SymbolContextScope *rhs_scope = rhs.GetSymbolContextScope();
- if (lhs_scope != NULL && rhs_scope != NULL)
+ if (lhs_scope != nullptr && rhs_scope != nullptr)
{
// Same exact scope, lhs is not less than (younger than rhs)
if (lhs_scope == rhs_scope)
// Items with the same function can only be compared
if (lhs_sc.function == rhs_sc.function &&
- lhs_sc.function != NULL && lhs_sc.block != NULL &&
- rhs_sc.function != NULL && rhs_sc.block != NULL)
+ lhs_sc.function != nullptr && lhs_sc.block != nullptr &&
+ rhs_sc.function != nullptr && rhs_sc.block != nullptr)
{
return rhs_sc.block->Contains (lhs_sc.block);
}
break;
}
}
- return all_internal == false;
+ return !all_internal;
}
}
return true;
for (size_t idx = 0; idx < num_owners; idx++)
{
const char *kind = bp_site_sp->GetOwnerAtIndex(idx)->GetBreakpoint().GetBreakpointKind();
- if (kind != NULL)
+ if (kind != nullptr)
{
m_description.assign (kind);
return kind;
// Next run the condition for the breakpoint. If that says we should stop, then we'll run
// the callback for the breakpoint. If the callback says we shouldn't stop that will win.
- if (bp_loc_sp->GetConditionText() != NULL)
+ if (bp_loc_sp->GetConditionText() != nullptr)
{
Error condition_error;
bool condition_says_stop = bp_loc_sp->ConditionSaysStop(exe_ctx, condition_error);
}
// We've figured out what this stop wants to do, so mark it as valid so we don't compute it again.
m_should_stop_is_valid = true;
-
}
else
{
new_plan_sp->SetOkayToDiscard (false);
new_plan_sp->SetPrivate (true);
process->GetThreadList().SetSelectedThreadByID (thread_sp->GetID());
- process->ResumeSynchronous(NULL);
+ process->ResumeSynchronous(nullptr);
process->GetThreadList().SetSelectedThreadByID (thread_sp->GetID());
thread_sp->SetStopInfo(stored_stop_info_sp);
}
if (wp_sp->GetHitCount() <= wp_sp->GetIgnoreCount())
m_should_stop = false;
- if (m_should_stop && wp_sp->GetConditionText() != NULL)
+ if (m_should_stop && wp_sp->GetConditionText() != nullptr)
{
// We need to make sure the user sees any parse errors in their condition, so we'll hook the
// constructor errors up to the debugger's Async I/O.
expr_options.SetIgnoreBreakpoints(true);
ValueObjectSP result_value_sp;
Error error;
- result_code = UserExpression::Evaluate (exe_ctx,
- expr_options,
- wp_sp->GetConditionText(),
- NULL,
- result_value_sp,
- error);
+ result_code = UserExpression::Evaluate(exe_ctx,
+ expr_options,
+ wp_sp->GetConditionText(),
+ nullptr,
+ result_value_sp,
+ error);
if (result_code == eExpressionCompleted)
{
ThreadSP thread_sp (m_thread_wp.lock());
if (thread_sp)
{
- if (thread_sp->GetProcess()->GetUnixSignals()->GetShouldSuppress(m_value) == false)
+ if (!thread_sp->GetProcess()->GetUnixSignals()->GetShouldSuppress(m_value))
thread_sp->SetResumeSignal(m_value);
}
}
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Process.h"
SystemRuntime*
SystemRuntime::FindPlugin (Process *process)
{
- SystemRuntimeCreateInstance create_callback = NULL;
- for (uint32_t idx = 0; (create_callback = PluginManager::GetSystemRuntimeCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ SystemRuntimeCreateInstance create_callback = nullptr;
+ for (uint32_t idx = 0; (create_callback = PluginManager::GetSystemRuntimeCreateCallbackAtIndex(idx)) != nullptr; ++idx)
{
std::unique_ptr<SystemRuntime> instance_ap(create_callback(process));
- if (instance_ap.get())
+ if (instance_ap)
return instance_ap.release();
}
- return NULL;
+ return nullptr;
}
-
//----------------------------------------------------------------------
// SystemRuntime constructor
//----------------------------------------------------------------------
{
}
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-SystemRuntime::~SystemRuntime()
-{
-}
+SystemRuntime::~SystemRuntime() = default;
void
SystemRuntime::DidAttach ()
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/UnixSignals.h"
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Target/UnixSignals.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Host/StringConvert.h"
-
#include "Plugins/Process/Utility/FreeBSDSignals.h"
#include "Plugins/Process/Utility/LinuxSignals.h"
#include "Plugins/Process/Utility/MipsLinuxSignals.h"
using namespace lldb_private;
-UnixSignals::Signal::Signal
-(
- const char *name,
- bool default_suppress,
- bool default_stop,
- bool default_notify,
- const char *description,
- const char *alias
-) :
+UnixSignals::Signal::Signal(const char *name,
+ bool default_suppress,
+ bool default_stop,
+ bool default_notify,
+ const char *description,
+ const char *alias) :
m_name (name),
m_alias (alias),
m_description (),
{
}
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-UnixSignals::~UnixSignals ()
-{
-}
+UnixSignals::~UnixSignals() = default;
void
UnixSignals::Reset ()
}
void
-UnixSignals::AddSignal
-(
- int signo,
- const char *name,
- bool default_suppress,
- bool default_stop,
- bool default_notify,
- const char *description,
- const char *alias
-)
+UnixSignals::AddSignal(int signo,
+ const char *name,
+ bool default_suppress,
+ bool default_stop,
+ bool default_notify,
+ const char *description,
+ const char *alias)
{
Signal new_signal (name, default_suppress, default_stop, default_notify, description, alias);
m_signals.insert (std::make_pair(signo, new_signal));
{
collection::const_iterator pos = m_signals.find (signo);
if (pos == m_signals.end())
- return NULL;
+ return nullptr;
else
return pos->second.m_name.GetCString ();
}
-
bool
UnixSignals::SignalIsValid (int32_t signo) const
{
}
const char *
-UnixSignals::GetSignalInfo
-(
- int32_t signo,
- bool &should_suppress,
- bool &should_stop,
- bool &should_notify
-) const
+UnixSignals::GetSignalInfo(int32_t signo,
+ bool &should_suppress,
+ bool &should_stop,
+ bool &should_notify) const
{
collection::const_iterator pos = m_signals.find (signo);
if (pos == m_signals.end())
- return NULL;
+ return nullptr;
else
{
const Signal &signal = pos->second;
-//===-- UnwindAssembly.cpp ------------------------------*- C++ -*-===//
+//===-- UnwindAssembly.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/PluginInterface.h"
UnwindAssemblyCreateInstance create_callback;
for (uint32_t idx = 0;
- (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != NULL;
+ (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != nullptr;
++idx)
{
UnwindAssemblySP assembly_profiler_ap (create_callback (arch));
- if (assembly_profiler_ap.get ())
+ if (assembly_profiler_ap)
return assembly_profiler_ap;
}
- return NULL;
+ return nullptr;
}
UnwindAssembly::UnwindAssembly (const ArchSpec &arch) :
{
}
-UnwindAssembly::~UnwindAssembly ()
-{
-}
+UnwindAssembly::~UnwindAssembly() = default;