diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-11-06 01:53:30 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-11-06 01:53:30 +0000 |
| commit | 2d4edfbc6ad8c8823791dd0285302282d2d2ed03 (patch) | |
| tree | c5462c66c46d3ed32bdd6738e948eb410cb0bfde /lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | |
| parent | 8e3d95e7dfb44fcd2d7fbf94f104fe821c42268e (diff) | |
| download | bcm5719-llvm-2d4edfbc6ad8c8823791dd0285302282d2d2ed03.tar.gz bcm5719-llvm-2d4edfbc6ad8c8823791dd0285302282d2d2ed03.zip | |
Modified all logging calls to hand out shared pointers to make sure we
don't crash if we disable logging when some code already has a copy of the
logger. Prior to this fix, logs were handed out as pointers and if they were
held onto while a log got disabled, then it could cause a crash. Now all logs
are handed out as shared pointers so this problem shouldn't happen anymore.
We are also using our new shared pointers that put the shared pointer count
and the object into the same allocation for a tad better performance.
llvm-svn: 118319
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index 28ef513f49b..dcfb1343297 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -147,7 +147,7 @@ RegisterContextLLDB::InitializeZerothFrame() m_cfa = cfa_regval + cfa_offset; - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); // A couple of sanity checks.. if (cfa_regval == LLDB_INVALID_ADDRESS || cfa_regval == 0 || cfa_regval == 1) @@ -176,7 +176,7 @@ RegisterContextLLDB::InitializeZerothFrame() void RegisterContextLLDB::InitializeNonZerothFrame() { - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (IsFrameZero ()) { m_frame_type = eNotAValidFrame; @@ -416,7 +416,7 @@ RegisterContextLLDB::GetFastUnwindPlanForFrame () if (fu->GetUnwindPlanFastUnwind (m_thread) && fu->GetUnwindPlanFastUnwind (m_thread)->PlanValidAtAddress (m_current_pc)) { - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (log && IsLogVerbose()) { const char *has_fast = ""; @@ -441,7 +441,7 @@ RegisterContextLLDB::GetFastUnwindPlanForFrame () UnwindPlan * RegisterContextLLDB::GetFullUnwindPlanForFrame () { - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); UnwindPlan *up; UnwindPlan *arch_default_up = NULL; ArchSpec arch = m_thread.GetProcess().GetTarget().GetArchitecture (); @@ -687,7 +687,7 @@ RegisterContextLLDB::IsValid () const bool RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, RegisterLocation ®loc) { - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); // Have we already found this register location? std::map<uint32_t, RegisterLocation>::const_iterator iterator; @@ -976,7 +976,7 @@ RegisterContextLLDB::ReadGPRValue (int register_kind, uint32_t regnum, addr_t &v bool RegisterContextLLDB::ReadRegisterBytes (uint32_t lldb_reg, DataExtractor& data) { - Log *log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND); + LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (!IsValid()) return false; |

