Fix naming

This commit is contained in:
firesgc 2025-01-25 11:52:43 +01:00
parent e75d5b7629
commit efc63cb49f
3 changed files with 19 additions and 19 deletions

View File

@ -36,16 +36,16 @@ namespace detail {
return itr->second; return itr->second;
} }
HANDLE duplicatedHandle = nullptr; HANDLE duplicated_handle = nullptr;
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"); throw internal_error("DuplicateHandle failed");
} }
if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { if(!SymInitialize(duplicated_handle , NULL, TRUE)) {
throw internal_error("SymInitialize failed {}", GetLastError()); throw internal_error("SymInitialize failed {}", GetLastError());
} }
cache[proc] = duplicatedHandle; cache[proc] = duplicated_handle ;
return duplicatedHandle; return duplicated_handle ;
} }
// Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held // Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held

View File

@ -427,21 +427,21 @@ namespace dbghelp {
// TODO: When does this need to be called? Can it be moved to the symbolizer? // TODO: When does this need to be called? Can it be moved to the symbolizer?
SymSetOptions(SYMOPT_ALLOW_ABSOLUTE_SYMBOLS); SymSetOptions(SYMOPT_ALLOW_ABSOLUTE_SYMBOLS);
HANDLE duplicatedHandle = nullptr; HANDLE duplicated_handle = nullptr;
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess();
if(get_cache_mode() == cache_mode::prioritize_speed) { if(get_cache_mode() == cache_mode::prioritize_speed) {
duplicatedHandle = get_syminit_manager().init(proc); duplicated_handle = get_syminit_manager().init(proc);
} else { } 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"); throw internal_error("DuplicateHandle failed");
} }
if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { if(!SymInitialize(duplicated_handle , NULL, TRUE)) {
throw internal_error("SymInitialize failed"); throw internal_error("SymInitialize failed");
} }
} }
for(const auto frame : frames) { for(const auto frame : frames) {
try { try {
trace.push_back(resolve_frame(duplicatedHandle, frame)); trace.push_back(resolve_frame(duplicated_handle , frame));
} catch(...) { // NOSONAR } catch(...) { // NOSONAR
if(!detail::should_absorb_trace_exceptions()) { if(!detail::should_absorb_trace_exceptions()) {
throw; throw;
@ -452,10 +452,10 @@ namespace dbghelp {
} }
} }
if(get_cache_mode() != cache_mode::prioritize_speed) { if(get_cache_mode() != cache_mode::prioritize_speed) {
if(!SymCleanup(duplicatedHandle)) { if(!SymCleanup(duplicated_handle )) {
throw internal_error("SymCleanup failed"); throw internal_error("SymCleanup failed");
} }
if (!CloseHandle(duplicatedHandle)) { if (!CloseHandle(duplicated_handle )) {
throw internal_error("CloseHandle failed"); throw internal_error("CloseHandle failed");
} }
} }

View File

@ -103,16 +103,16 @@ namespace detail {
// SymInitialize( GetCurrentProcess(), NULL, TRUE ) has // SymInitialize( GetCurrentProcess(), NULL, TRUE ) has
// already been called. // already been called.
// //
HANDLE duplicatedHandle = nullptr; HANDLE duplicated_handle = nullptr;
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess();
HANDLE thread = GetCurrentThread(); HANDLE thread = GetCurrentThread();
if(get_cache_mode() == cache_mode::prioritize_speed) { if(get_cache_mode() == cache_mode::prioritize_speed) {
duplicatedHandle = get_syminit_manager().init(proc); duplicated_handle = get_syminit_manager().init(proc);
} else { } 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"); throw internal_error("DuplicateHandle failed");
} }
if(!SymInitialize(duplicatedHandle, NULL, TRUE)) { if(!SymInitialize(duplicated_handle , NULL, TRUE)) {
throw internal_error("SymInitialize failed"); throw internal_error("SymInitialize failed");
} }
} }
@ -120,7 +120,7 @@ namespace detail {
if( if(
!StackWalk64( !StackWalk64(
machine_type, machine_type,
duplicatedHandle, duplicated_handle ,
thread, thread,
&frame, &frame,
machine_type == IMAGE_FILE_MACHINE_I386 ? NULL : &context, machine_type == IMAGE_FILE_MACHINE_I386 ? NULL : &context,
@ -149,10 +149,10 @@ namespace detail {
} }
} }
if(get_cache_mode() != cache_mode::prioritize_speed) { if(get_cache_mode() != cache_mode::prioritize_speed) {
if(!SymCleanup(duplicatedHandle)) { if(!SymCleanup(duplicated_handle )) {
throw internal_error("SymCleanup failed"); throw internal_error("SymCleanup failed");
} }
if (!CloseHandle(duplicatedHandle)) { if (!CloseHandle(duplicated_handle )) {
throw internal_error("CloseHandle failed"); throw internal_error("CloseHandle failed");
} }
} }