From efc63cb49fe6b692ffa318cdebf0d51c744a4cee Mon Sep 17 00:00:00 2001 From: firesgc Date: Sat, 25 Jan 2025 11:52:43 +0100 Subject: [PATCH] Fix naming --- src/platform/dbghelp_syminit_manager.cpp | 10 +++++----- src/symbols/symbols_with_dbghelp.cpp | 14 +++++++------- src/unwind/unwind_with_dbghelp.cpp | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/platform/dbghelp_syminit_manager.cpp b/src/platform/dbghelp_syminit_manager.cpp index 1dc635a..2b4dc39 100644 --- a/src/platform/dbghelp_syminit_manager.cpp +++ b/src/platform/dbghelp_syminit_manager.cpp @@ -36,16 +36,16 @@ namespace detail { return itr->second; } - HANDLE duplicatedHandle = nullptr; - if (!DuplicateHandle(proc, proc, proc, &duplicatedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { + HANDLE duplicated_handle = nullptr; + if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) { throw internal_error("DuplicateHandle failed"); } - if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { + if(!SymInitialize(duplicated_handle , NULL, TRUE)) { throw internal_error("SymInitialize failed {}", GetLastError()); } - cache[proc] = duplicatedHandle; - return duplicatedHandle; + cache[proc] = duplicated_handle ; + return duplicated_handle ; } // Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held diff --git a/src/symbols/symbols_with_dbghelp.cpp b/src/symbols/symbols_with_dbghelp.cpp index 94eb3a3..c3a6eae 100644 --- a/src/symbols/symbols_with_dbghelp.cpp +++ b/src/symbols/symbols_with_dbghelp.cpp @@ -427,21 +427,21 @@ namespace dbghelp { // TODO: When does this need to be called? Can it be moved to the symbolizer? SymSetOptions(SYMOPT_ALLOW_ABSOLUTE_SYMBOLS); - HANDLE duplicatedHandle = nullptr; + HANDLE duplicated_handle = nullptr; HANDLE proc = GetCurrentProcess(); if(get_cache_mode() == cache_mode::prioritize_speed) { - duplicatedHandle = get_syminit_manager().init(proc); + duplicated_handle = get_syminit_manager().init(proc); } else { - if (!DuplicateHandle(proc, proc, proc, &duplicatedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { + if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) { throw internal_error("DuplicateHandle failed"); } - if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { + if(!SymInitialize(duplicated_handle , NULL, TRUE)) { throw internal_error("SymInitialize failed"); } } for(const auto frame : frames) { try { - trace.push_back(resolve_frame(duplicatedHandle, frame)); + trace.push_back(resolve_frame(duplicated_handle , frame)); } catch(...) { // NOSONAR if(!detail::should_absorb_trace_exceptions()) { throw; @@ -452,10 +452,10 @@ namespace dbghelp { } } if(get_cache_mode() != cache_mode::prioritize_speed) { - if(!SymCleanup(duplicatedHandle)) { + if(!SymCleanup(duplicated_handle )) { throw internal_error("SymCleanup failed"); } - if (!CloseHandle(duplicatedHandle)) { + if (!CloseHandle(duplicated_handle )) { throw internal_error("CloseHandle failed"); } } diff --git a/src/unwind/unwind_with_dbghelp.cpp b/src/unwind/unwind_with_dbghelp.cpp index 949d796..66c4e86 100644 --- a/src/unwind/unwind_with_dbghelp.cpp +++ b/src/unwind/unwind_with_dbghelp.cpp @@ -103,16 +103,16 @@ namespace detail { // SymInitialize( GetCurrentProcess(), NULL, TRUE ) has // already been called. // - HANDLE duplicatedHandle = nullptr; + HANDLE duplicated_handle = nullptr; HANDLE proc = GetCurrentProcess(); HANDLE thread = GetCurrentThread(); if(get_cache_mode() == cache_mode::prioritize_speed) { - duplicatedHandle = get_syminit_manager().init(proc); + duplicated_handle = get_syminit_manager().init(proc); } else { - if (!DuplicateHandle(proc, proc, proc, &duplicatedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { + if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) { throw internal_error("DuplicateHandle failed"); } - if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { + if(!SymInitialize(duplicated_handle , NULL, TRUE)) { throw internal_error("SymInitialize failed"); } } @@ -120,7 +120,7 @@ namespace detail { if( !StackWalk64( machine_type, - duplicatedHandle, + duplicated_handle , thread, &frame, machine_type == IMAGE_FILE_MACHINE_I386 ? NULL : &context, @@ -149,10 +149,10 @@ namespace detail { } } if(get_cache_mode() != cache_mode::prioritize_speed) { - if(!SymCleanup(duplicatedHandle)) { + if(!SymCleanup(duplicated_handle )) { throw internal_error("SymCleanup failed"); } - if (!CloseHandle(duplicatedHandle)) { + if (!CloseHandle(duplicated_handle )) { throw internal_error("CloseHandle failed"); } }