diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Breakpoint/Breakpoint.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocation.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointOptions.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 53 | ||||
-rw-r--r-- | lldb/source/Core/SearchFilter.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Interpreter/Options.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Target/StackFrame.cpp | 52 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Target/Thread.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanTestCondition.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Utility/SharingPtr.cpp | 13 |
16 files changed, 88 insertions, 105 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp index 4fa77dd7135..6da2625056d 100644 --- a/lldb/source/Breakpoint/Breakpoint.cpp +++ b/lldb/source/Breakpoint/Breakpoint.cpp @@ -124,13 +124,6 @@ Breakpoint::GetLocationAtIndex (uint32_t index) return m_locations.GetByIndex(index); } -BreakpointLocationSP -Breakpoint::GetLocationSP (BreakpointLocation *bp_loc_ptr) -{ - return m_locations.FindByID(bp_loc_ptr->GetID()); -} - - // For each of the overall options we need to decide how they propagate to // the location options. This will determine the precedence of options on // the breakpoint vrs. its locations. @@ -567,5 +560,7 @@ Breakpoint::GetFilterDescription (Stream *s) const BreakpointSP Breakpoint::GetSP () { - return m_target.GetBreakpointList().FindBreakpointByID (GetID()); + // This object contains an instrusive ref count base class so we can + // easily make a shared pointer to this object + return BreakpointSP (this); } diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index ce5482fec57..58f18e2f801 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -149,11 +149,11 @@ BreakpointLocation::SetCondition (const char *condition) ThreadPlan * BreakpointLocation::GetThreadPlanToTestCondition (ExecutionContext &exe_ctx, Stream &error) { - lldb::BreakpointLocationSP my_sp(m_owner.GetLocationSP(this)); + lldb::BreakpointLocationSP this_sp(this); if (m_options_ap.get()) - return m_options_ap->GetThreadPlanToTestCondition (exe_ctx, my_sp, error); + return m_options_ap->GetThreadPlanToTestCondition (exe_ctx, this_sp, error); else - return m_owner.GetThreadPlanToTestCondition (exe_ctx, my_sp, error); + return m_owner.GetThreadPlanToTestCondition (exe_ctx, this_sp, error); } const char * @@ -259,9 +259,9 @@ BreakpointLocation::ResolveBreakpointSite () if (m_owner.GetTarget().GetSectionLoadList().IsEmpty()) return false; - BreakpointLocationSP myself_sp(m_owner.GetLocationSP (this)); + BreakpointLocationSP this_sp(this); - lldb::break_id_t new_id = process->CreateBreakpointSite (myself_sp, false); + lldb::break_id_t new_id = process->CreateBreakpointSite (this_sp, false); if (new_id == LLDB_INVALID_BREAK_ID) { diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index f0f18457fd2..df41339ab8f 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -172,7 +172,7 @@ BreakpointOptions::SetCondition (const char *condition) ThreadPlan * BreakpointOptions::GetThreadPlanToTestCondition (ExecutionContext &exe_ctx, - lldb::BreakpointLocationSP break_loc_sp, + const BreakpointLocationSP &break_loc_sp, Stream &error_stream) { // No condition means we should stop, so return NULL. diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 20641acf117..88a130d3982 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -574,7 +574,7 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe if (args.GetArgumentCount() == 0) { - if (target->GetLastCreatedBreakpoint() != NULL) + if (target->GetLastCreatedBreakpoint()) { valid_ids->AddBreakpointID (BreakpointID(target->GetLastCreatedBreakpoint()->GetID(), LLDB_INVALID_BREAK_ID)); result.SetStatus (eReturnStatusSuccessFinishNoResult); diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 91898152870..debba813a85 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -152,7 +152,7 @@ Debugger::CreateInstance () } void -Debugger::Destroy (lldb::DebuggerSP &debugger_sp) +Debugger::Destroy (DebuggerSP &debugger_sp) { if (debugger_sp.get() == NULL) return; @@ -172,29 +172,18 @@ Debugger::Destroy (lldb::DebuggerSP &debugger_sp) } } -lldb::DebuggerSP +DebuggerSP Debugger::GetSP () { - lldb::DebuggerSP debugger_sp; - - Mutex::Locker locker (GetDebuggerListMutex ()); - DebuggerList &debugger_list = GetDebuggerList(); - DebuggerList::iterator pos, end = debugger_list.end(); - for (pos = debugger_list.begin(); pos != end; ++pos) - { - if ((*pos).get() == this) - { - debugger_sp = *pos; - break; - } - } - return debugger_sp; + // This object contains an instrusive ref count base class so we can + // easily make a shared pointer to this object + return DebuggerSP (this); } -lldb::DebuggerSP +DebuggerSP Debugger::FindDebuggerWithInstanceName (const ConstString &instance_name) { - lldb::DebuggerSP debugger_sp; + DebuggerSP debugger_sp; Mutex::Locker locker (GetDebuggerListMutex ()); DebuggerList &debugger_list = GetDebuggerList(); @@ -214,7 +203,7 @@ Debugger::FindDebuggerWithInstanceName (const ConstString &instance_name) TargetSP Debugger::FindTargetWithProcessID (lldb::pid_t pid) { - lldb::TargetSP target_sp; + TargetSP target_sp; Mutex::Locker locker (GetDebuggerListMutex ()); DebuggerList &debugger_list = GetDebuggerList(); DebuggerList::iterator pos, end = debugger_list.end(); @@ -350,7 +339,7 @@ Debugger::GetSelectedExecutionContext () ExecutionContext exe_ctx; exe_ctx.Clear(); - lldb::TargetSP target_sp = GetSelectedTarget(); + TargetSP target_sp = GetSelectedTarget(); exe_ctx.target = target_sp.get(); if (target_sp) @@ -469,7 +458,7 @@ Debugger::NotifyTopInputReader (InputReaderAction notification) } bool -Debugger::InputReaderIsTopReader (const lldb::InputReaderSP& reader_sp) +Debugger::InputReaderIsTopReader (const InputReaderSP& reader_sp) { InputReaderSP top_reader_sp (GetCurrentInputReader()); @@ -531,7 +520,7 @@ Debugger::PushInputReader (const InputReaderSP& reader_sp) } bool -Debugger::PopInputReader (const lldb::InputReaderSP& pop_reader_sp) +Debugger::PopInputReader (const InputReaderSP& pop_reader_sp) { bool result = false; @@ -627,7 +616,7 @@ Debugger::GetAsyncErrorStream () DebuggerSP Debugger::FindDebuggerWithID (lldb::user_id_t id) { - lldb::DebuggerSP debugger_sp; + DebuggerSP debugger_sp; Mutex::Locker locker (GetDebuggerListMutex ()); DebuggerList &debugger_list = GetDebuggerList(); @@ -710,7 +699,7 @@ ScanFormatDescriptor (const char* var_name_begin, const char* var_name_end, const char** var_name_final, const char** percent_position, - lldb::Format* custom_format, + Format* custom_format, ValueObject::ValueObjectRepresentationStyle* val_obj_display) { LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); @@ -1033,7 +1022,7 @@ Debugger::FormatPrompt if (*var_name_begin == 's') { - valobj = valobj->GetSyntheticValue(lldb::eUseSyntheticFilter).get(); + valobj = valobj->GetSyntheticValue(eUseSyntheticFilter).get(); var_name_begin++; } @@ -1053,7 +1042,7 @@ Debugger::FormatPrompt options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().DoAllowSyntheticChildren(); ValueObject::ValueObjectRepresentationStyle val_obj_display = ValueObject::eDisplaySummary; ValueObject* target = NULL; - lldb::Format custom_format = eFormatInvalid; + Format custom_format = eFormatInvalid; const char* var_name_final = NULL; const char* var_name_final_if_array_range = NULL; const char* close_bracket_position = NULL; @@ -1847,7 +1836,7 @@ Debugger::FormatPrompt //-------------------------------------------------- Debugger::SettingsController::SettingsController () : - UserSettingsController ("", lldb::UserSettingsControllerSP()) + UserSettingsController ("", UserSettingsControllerSP()) { m_default_settings.reset (new DebuggerInstanceSettings (*this, false, InstanceSettings::GetDefaultName().AsCString())); @@ -1858,12 +1847,12 @@ Debugger::SettingsController::~SettingsController () } -lldb::InstanceSettingsSP +InstanceSettingsSP Debugger::SettingsController::CreateInstanceSettings (const char *instance_name) { DebuggerInstanceSettings *new_settings = new DebuggerInstanceSettings (*GetSettingsController(), false, instance_name); - lldb::InstanceSettingsSP new_settings_sp (new_settings); + InstanceSettingsSP new_settings_sp (new_settings); return new_settings_sp; } @@ -1900,7 +1889,7 @@ DebuggerInstanceSettings::DebuggerInstanceSettings if (live_instance) { - const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); + const InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); CopyInstanceSettings (pending_settings, false); } } @@ -1914,7 +1903,7 @@ DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettin m_use_external_editor (rhs.m_use_external_editor), m_auto_confirm_on(rhs.m_auto_confirm_on) { - const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); + const InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); CopyInstanceSettings (pending_settings, false); m_owner.RemovePendingSettings (m_instance_name); } @@ -2082,7 +2071,7 @@ DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry, } void -DebuggerInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings, +DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings, bool pending) { if (new_settings.get() == NULL) diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index adcc1caf314..8a9140df50d 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -131,7 +131,7 @@ SearchFilter::Search (Searcher &searcher) { SymbolContext empty_sc; - if (m_target_sp == NULL) + if (!m_target_sp) return; empty_sc.target_sp = m_target_sp; @@ -146,7 +146,7 @@ SearchFilter::SearchInModuleList (Searcher &searcher, ModuleList &modules) { SymbolContext empty_sc; - if (m_target_sp == NULL) + if (!m_target_sp) return; empty_sc.target_sp = m_target_sp; diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index d0dd4a5f022..ea256f09948 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -75,9 +75,15 @@ ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx) else if (exe_ctx.thread) m_parser_vars->m_sym_ctx = exe_ctx.thread->GetStackFrameAtIndex(0)->GetSymbolContext(lldb::eSymbolContextEverything); else if (exe_ctx.process) - m_parser_vars->m_sym_ctx = SymbolContext(exe_ctx.target->GetSP(), ModuleSP()); + { + m_parser_vars->m_sym_ctx.Clear(); + m_parser_vars->m_sym_ctx.target_sp = exe_ctx.target; + } else if (exe_ctx.target) - m_parser_vars->m_sym_ctx = SymbolContext(exe_ctx.target->GetSP(), ModuleSP()); + { + m_parser_vars->m_sym_ctx.Clear(); + m_parser_vars->m_sym_ctx.target_sp = exe_ctx.target; + } if (exe_ctx.target) m_parser_vars->m_persistent_vars = &exe_ctx.target->GetPersistentVariables(); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 2351345100d..5e9f04798af 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -886,7 +886,7 @@ Options::HandleOptionArgumentCompletion FileSpec module_spec(module_name, false); lldb::TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget(); // Search filters require a target... - if (target_sp != NULL) + if (target_sp) filter_ap.reset (new SearchFilterByModule (target_sp, module_spec)); } break; diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 18c7b990fd8..91fb9273b15 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -19,6 +19,7 @@ #include <string> #include "lldb/API/SBValue.h" +#include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Timer.h" diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 9a5dbc255c9..f1efea260d0 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -373,7 +373,7 @@ AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols () if (changed_addr != LLDB_INVALID_ADDRESS) { BreakpointSP trampolines_changed_bp_sp = target.CreateBreakpoint (changed_addr, true); - if (trampolines_changed_bp_sp != NULL) + if (trampolines_changed_bp_sp) { m_trampolines_changed_bp_id = trampolines_changed_bp_sp->GetID(); trampolines_changed_bp_sp->SetCallback (RefreshTrampolines, this, true); diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 3fdc2a71bc6..c1deb46ac5d 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1416,22 +1416,22 @@ Process::RemoveBreakpointOpcodesFromBuffer (addr_t bp_addr, size_t size, uint8_t size_t intersect_size; size_t opcode_offset; size_t idx; - BreakpointSiteSP bp; + BreakpointSiteSP bp_sp; BreakpointSiteList bp_sites_in_range; if (m_breakpoint_site_list.FindInRange (bp_addr, bp_addr + size, bp_sites_in_range)) { - for (idx = 0; (bp = bp_sites_in_range.GetByIndex(idx)) != NULL; ++idx) + for (idx = 0; (bp_sp = bp_sites_in_range.GetByIndex(idx)); ++idx) { - if (bp->GetType() == BreakpointSite::eSoftware) + if (bp_sp->GetType() == BreakpointSite::eSoftware) { - if (bp->IntersectsRange(bp_addr, size, &intersect_addr, &intersect_size, &opcode_offset)) + if (bp_sp->IntersectsRange(bp_addr, size, &intersect_addr, &intersect_size, &opcode_offset)) { assert(bp_addr <= intersect_addr && intersect_addr < bp_addr + size); assert(bp_addr < intersect_addr + intersect_size && intersect_addr + intersect_size <= bp_addr + size); - assert(opcode_offset + intersect_size <= bp->GetByteSize()); + assert(opcode_offset + intersect_size <= bp_sp->GetByteSize()); size_t buf_offset = intersect_addr - bp_addr; - ::memcpy(buf + buf_offset, bp->GetSavedOpcodeBytes() + opcode_offset, intersect_size); + ::memcpy(buf + buf_offset, bp_sp->GetSavedOpcodeBytes() + opcode_offset, intersect_size); } } } diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 2b13fe8c364..ff05bc80dba 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -41,11 +41,11 @@ using namespace lldb_private; StackFrame::StackFrame ( - lldb::user_id_t frame_idx, - lldb::user_id_t unwind_frame_index, + user_id_t frame_idx, + user_id_t unwind_frame_index, Thread &thread, - lldb::addr_t cfa, - lldb::addr_t pc, + addr_t cfa, + addr_t pc, const SymbolContext *sc_ptr ) : m_thread (thread), @@ -71,12 +71,12 @@ StackFrame::StackFrame StackFrame::StackFrame ( - lldb::user_id_t frame_idx, - lldb::user_id_t unwind_frame_index, + user_id_t frame_idx, + user_id_t unwind_frame_index, Thread &thread, const RegisterContextSP ®_context_sp, - lldb::addr_t cfa, - lldb::addr_t pc, + addr_t cfa, + addr_t pc, const SymbolContext *sc_ptr ) : m_thread (thread), @@ -108,11 +108,11 @@ StackFrame::StackFrame StackFrame::StackFrame ( - lldb::user_id_t frame_idx, - lldb::user_id_t unwind_frame_index, + user_id_t frame_idx, + user_id_t unwind_frame_index, Thread &thread, const RegisterContextSP ®_context_sp, - lldb::addr_t cfa, + addr_t cfa, const Address& pc_addr, const SymbolContext *sc_ptr ) : @@ -515,9 +515,9 @@ StackFrame::GetInScopeVariableList (bool get_file_globals) ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, - lldb::DynamicValueType use_dynamic, + DynamicValueType use_dynamic, uint32_t options, - lldb::VariableSP &var_sp, + VariableSP &var_sp, Error &error) { @@ -643,7 +643,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, if (!child_valobj_sp) { if (no_synth_child == false) - child_valobj_sp = valobj_sp->GetSyntheticValue(lldb::eUseSyntheticFilter)->GetChildMemberWithName (child_name, true); + child_valobj_sp = valobj_sp->GetSyntheticValue(eUseSyntheticFilter)->GetChildMemberWithName (child_name, true); if (no_synth_child || !child_valobj_sp) { @@ -667,7 +667,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, } // Remove the child name from the path var_path.erase(0, child_name.GetLength()); - if (use_dynamic != lldb::eNoDynamicValues) + if (use_dynamic != eNoDynamicValues) { ValueObjectSP dynamic_value_sp(child_valobj_sp->GetDynamicValue(use_dynamic)); if (dynamic_value_sp) @@ -728,12 +728,12 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, if (no_synth_child == false && ClangASTType::GetMinimumLanguage(valobj_sp->GetClangAST(), - valobj_sp->GetClangType()) == lldb::eLanguageTypeObjC /* is ObjC pointer */ + valobj_sp->GetClangType()) == eLanguageTypeObjC /* is ObjC pointer */ && ClangASTContext::IsPointerType(ClangASTType::GetPointeeType(valobj_sp->GetClangType())) == false /* is not double-ptr */) { // dereferencing ObjC variables is not valid.. so let's try and recur to synthetic children - lldb::ValueObjectSP synthetic = valobj_sp->GetSyntheticValue(lldb::eUseSyntheticFilter); + ValueObjectSP synthetic = valobj_sp->GetSyntheticValue(eUseSyntheticFilter); if (synthetic.get() == NULL /* no synthetic */ || synthetic == valobj_sp) /* synthetic is the same as the original object */ { @@ -805,7 +805,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, } else { - lldb::ValueObjectSP synthetic = valobj_sp->GetSyntheticValue(lldb::eUseSyntheticFilter); + ValueObjectSP synthetic = valobj_sp->GetSyntheticValue(eUseSyntheticFilter); if (no_synth_child /* synthetic is forbidden */ || synthetic.get() == NULL /* no synthetic */ || synthetic == valobj_sp) /* synthetic is the same as the original object */ @@ -847,7 +847,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, // %i is the array index var_path.erase(0, (end - var_path.c_str()) + 1); separator_idx = var_path.find_first_of(".-["); - if (use_dynamic != lldb::eNoDynamicValues) + if (use_dynamic != eNoDynamicValues) { ValueObjectSP dynamic_value_sp(child_valobj_sp->GetDynamicValue(use_dynamic)); if (dynamic_value_sp) @@ -948,7 +948,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, // %i is the index var_path.erase(0, (real_end - var_path.c_str()) + 1); separator_idx = var_path.find_first_of(".-["); - if (use_dynamic != lldb::eNoDynamicValues) + if (use_dynamic != eNoDynamicValues) { ValueObjectSP dynamic_value_sp(child_valobj_sp->GetDynamicValue(use_dynamic)); if (dynamic_value_sp) @@ -1077,7 +1077,7 @@ StackFrame::HasDebugInformation () ValueObjectSP -StackFrame::GetValueObjectForFrameVariable (const VariableSP &variable_sp, lldb::DynamicValueType use_dynamic) +StackFrame::GetValueObjectForFrameVariable (const VariableSP &variable_sp, DynamicValueType use_dynamic) { ValueObjectSP valobj_sp; VariableList *var_list = GetVariableList (true); @@ -1098,7 +1098,7 @@ StackFrame::GetValueObjectForFrameVariable (const VariableSP &variable_sp, lldb: } } } - if (use_dynamic != lldb::eNoDynamicValues && valobj_sp) + if (use_dynamic != eNoDynamicValues && valobj_sp) { ValueObjectSP dynamic_sp = valobj_sp->GetDynamicValue (use_dynamic); if (dynamic_sp) @@ -1108,7 +1108,7 @@ StackFrame::GetValueObjectForFrameVariable (const VariableSP &variable_sp, lldb: } ValueObjectSP -StackFrame::TrackGlobalVariable (const VariableSP &variable_sp, lldb::DynamicValueType use_dynamic) +StackFrame::TrackGlobalVariable (const VariableSP &variable_sp, DynamicValueType use_dynamic) { // Check to make sure we aren't already tracking this variable? ValueObjectSP valobj_sp (GetValueObjectForFrameVariable (variable_sp, use_dynamic)); @@ -1254,10 +1254,12 @@ StackFrame::HasCachedData () const return false; } -lldb::StackFrameSP +StackFrameSP StackFrame::GetSP () { - return m_thread.GetStackFrameSPForStackFramePtr (this); + // This object contains an instrusive ref count base class so we can + // easily make a shared pointer to this object + return StackFrameSP (this); } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index ca9e936b2bb..d6c2dc2e086 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -146,7 +146,9 @@ Target::GetProcessSP () const lldb::TargetSP Target::GetSP() { - return m_debugger.GetTargetList().GetTargetSP(this); + // This object contains an instrusive ref count base class so we can + // easily make a shared pointer to this object + return TargetSP(this); } void diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index babb2dd6848..7c29da20481 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -970,7 +970,9 @@ Thread::DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx) lldb::ThreadSP Thread::GetSP () { - return m_process.GetThreadList().GetThreadSPForThreadPtr(this); + // This object contains an instrusive ref count base class so we can + // easily make a shared pointer to this object + return ThreadSP(this); } diff --git a/lldb/source/Target/ThreadPlanTestCondition.cpp b/lldb/source/Target/ThreadPlanTestCondition.cpp index 0c3c0e22caa..9c17ac3b61a 100644 --- a/lldb/source/Target/ThreadPlanTestCondition.cpp +++ b/lldb/source/Target/ThreadPlanTestCondition.cpp @@ -37,12 +37,11 @@ using namespace lldb_private; // based on the value of \a type. //---------------------------------------------------------------------- -ThreadPlanTestCondition::ThreadPlanTestCondition ( - Thread& thread, - ExecutionContext &exe_ctx, - ClangUserExpression *expression, - lldb::BreakpointLocationSP break_loc_sp, - bool stop_others) : +ThreadPlanTestCondition::ThreadPlanTestCondition (Thread& thread, + ExecutionContext &exe_ctx, + ClangUserExpression *expression, + const BreakpointLocationSP &break_loc_sp, + bool stop_others) : ThreadPlan (ThreadPlan::eKindTestCondition, "test condition", thread, eVoteNoOpinion, eVoteNoOpinion), m_expression (expression), m_exe_ctx (exe_ctx), diff --git a/lldb/source/Utility/SharingPtr.cpp b/lldb/source/Utility/SharingPtr.cpp index 3ee01285a3b..26c8d1ffd88 100644 --- a/lldb/source/Utility/SharingPtr.cpp +++ b/lldb/source/Utility/SharingPtr.cpp @@ -14,19 +14,6 @@ namespace lldb_private { namespace imp { - template <class T> - inline T - increment(T& t) - { - return __sync_add_and_fetch(&t, 1); - } - - template <class T> - inline T - decrement(T& t) - { - return __sync_add_and_fetch(&t, -1); - } shared_count::~shared_count() { |