From 2ed41f8cd00157d621a6cc210a50ebd7594e9cec Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 9 Dec 2019 17:19:48 -0800 Subject: [PATCH] Misc fixes Issue: https://github.com/dotnet/diagnostics/issues/673 --- src/SOS/Strike/hostcoreclr.cpp | 20 ++++++++++++-------- src/inc/palclr.h | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/SOS/Strike/hostcoreclr.cpp b/src/SOS/Strike/hostcoreclr.cpp index 34f6e03604..a206226e61 100644 --- a/src/SOS/Strike/hostcoreclr.cpp +++ b/src/SOS/Strike/hostcoreclr.cpp @@ -807,17 +807,21 @@ void InitializeSymbolStoreFromSymPath() { if (g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate != nullptr) { - ArrayHolder symbolPath = new char[MAX_LONGPATH]; - if (SUCCEEDED(g_ExtSymbols->GetSymbolPath(symbolPath, MAX_LONGPATH, nullptr))) + ULONG cchLength = 0; + if (SUCCEEDED(g_ExtSymbols->GetSymbolPath(nullptr, 0, &cchLength))) { - if (strlen(symbolPath) > 0) - { - if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(false, false, false, GetTempDirectory(), nullptr, nullptr, nullptr, symbolPath)) + ArrayHolder symbolPath = new char[cchLength]; + if (SUCCEEDED(g_ExtSymbols->GetSymbolPath(symbolPath, cchLength, nullptr))) + { + if (strlen(symbolPath) > 0) { - ExtErr("Windows symbol path parsing FAILED\n"); - return; + if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(false, false, false, GetTempDirectory(), nullptr, nullptr, nullptr, symbolPath)) + { + ExtErr("Windows symbol path parsing FAILED\n"); + return; + } + g_symbolStoreInitialized = true; } - g_symbolStoreInitialized = true; } } } diff --git a/src/inc/palclr.h b/src/inc/palclr.h index bba278b776..fb3e25a187 100644 --- a/src/inc/palclr.h +++ b/src/inc/palclr.h @@ -613,10 +613,10 @@ #endif #if !defined(MAX_LONGPATH) -#define MAX_LONGPATH 260 /* max. length of full pathname */ +#define MAX_LONGPATH 1024 /* max. length of full pathname */ #endif #if !defined(MAX_PATH_FNAME) -#define MAX_PATH_FNAME MAX_PATH /* max. length of full pathname */ +#define MAX_PATH_FNAME MAX_PATH /* max. length of full pathname */ #endif #define __clr_reserved __reserved