diff options
| author | Jason Molenda <jmolenda@apple.com> | 2012-10-04 22:47:07 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2012-10-04 22:47:07 +0000 |
| commit | ccd41e55f1cd1a2a99bd357076638954f419429a (patch) | |
| tree | 7093042eeeef422e29e4448976973272005341ca /lldb/source/Target | |
| parent | bfeb28087ae76b6c241a6dc1727429fe8f6f76a7 (diff) | |
| download | bcm5719-llvm-ccd41e55f1cd1a2a99bd357076638954f419429a.tar.gz bcm5719-llvm-ccd41e55f1cd1a2a99bd357076638954f419429a.zip | |
Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing
Mutex::Locker(m_map_mutex);
This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately. Instead,
Mutex::Locker locker(m_map_mutex);
does what is intended. For some reason -Wshadow happened to
highlight these as shadowed variables.
I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>
llvm-svn: 165269
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/Process.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Target/StopInfo.cpp | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 5858f9972f2..2dbe88f76dd 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3131,7 +3131,6 @@ Process::Destroy () if (state != eStateStopped) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) log->Printf("Process::Destroy() Halt failed to stop, state is: %s", StateAsCString(state)); // If we really couldn't stop the process then we should just error out here, but if the @@ -3147,7 +3146,6 @@ Process::Destroy () } else { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) log->Printf("Process::Destroy() Halt got error: %s", error.AsCString()); return error; diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index b9c70d97c09..26c2cf5e663 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -316,10 +316,10 @@ public: { m_should_stop = true; m_should_stop_is_valid = true; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + LogSP log_process(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); - if (log) - log->Printf ("Process::%s could not find breakpoint site id: %lld...", __FUNCTION__, m_value); + if (log_process) + log_process->Printf ("Process::%s could not find breakpoint site id: %lld...", __FUNCTION__, m_value); } if (log) log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop); @@ -676,10 +676,10 @@ public: } else { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + LogSP log_process(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); - if (log) - log->Printf ("Process::%s could not find watchpoint id: %lld...", __FUNCTION__, m_value); + if (log_process) + log_process->Printf ("Process::%s could not find watchpoint id: %lld...", __FUNCTION__, m_value); } if (log) log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop); |

