From b22cca6c3b8e10410a10fc796669b36e1c3d0453 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Thu, 5 May 2016 09:48:27 -0700 Subject: [PATCH] win: Avoid variable shadowing warning for `thread_id` on VS2015 R=mark@chromium.org Change-Id: I0bf09c96715161827bdad70bb375ad8193456d28 Reviewed-on: https://chromium-review.googlesource.com/342634 Reviewed-by: Mark Mentovai --- snapshot/win/exception_snapshot_win.cc | 12 ++++++------ snapshot/win/exception_snapshot_win.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/snapshot/win/exception_snapshot_win.cc b/snapshot/win/exception_snapshot_win.cc index 8e96d342..c0d63bad 100644 --- a/snapshot/win/exception_snapshot_win.cc +++ b/snapshot/win/exception_snapshot_win.cc @@ -169,7 +169,7 @@ template DecrementThreadSuspendCounts(thread_id); + process_reader->DecrementThreadSuspendCounts(exception_thread_id); if (triggered_by_client && first_record.ExceptionInformation[0] != 0) { // This special exception code indicates that the target was crashed by @@ -206,12 +206,12 @@ bool ExceptionSnapshotWin::InitializeFromExceptionPointers( // this case the parameters are a thread id and an exception code which we // use to fabricate a new exception record. using ArgumentType = decltype(first_record.ExceptionInformation[0]); - const ArgumentType thread_id = first_record.ExceptionInformation[0]; + const ArgumentType blame_thread_id = first_record.ExceptionInformation[0]; exception_code_ = static_cast(first_record.ExceptionInformation[1]); exception_flags_ = EXCEPTION_NONCONTINUABLE; for (const auto& thread : process_reader->Threads()) { - if (thread.id == thread_id) { - thread_id_ = thread_id; + if (thread.id == blame_thread_id) { + thread_id_ = blame_thread_id; native_to_cpu_context( *reinterpret_cast(&thread.context), &context_, @@ -222,7 +222,7 @@ bool ExceptionSnapshotWin::InitializeFromExceptionPointers( } if (exception_address_ == 0) { - LOG(WARNING) << "thread " << thread_id << " not found"; + LOG(WARNING) << "thread " << blame_thread_id << " not found"; return false; } } else { diff --git a/snapshot/win/exception_snapshot_win.h b/snapshot/win/exception_snapshot_win.h index 69e81777..3ccf38ae 100644 --- a/snapshot/win/exception_snapshot_win.h +++ b/snapshot/win/exception_snapshot_win.h @@ -84,7 +84,7 @@ class ExceptionSnapshotWin final : public ExceptionSnapshot { bool InitializeFromExceptionPointers( ProcessReaderWin* process_reader, WinVMAddress exception_pointers_address, - DWORD thread_id, + DWORD exception_thread_id, void (*native_to_cpu_context)(const ContextType& context_record, CPUContext* context, CPUContextUnion* context_union));