From 25f17649753c881f0abfa67e90402ef8fc5a54f3 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Thu, 22 Oct 2020 20:37:15 -0700 Subject: [PATCH] Clarify confusing GUID-length message The GUID parameter to RetrieveSymbols must be exactly 32 characters in length but when it isn't the tool wouldn't tell you what the length was. It would also print some confusing information about trimmed GUIDs which was not always relevant. Now it prints the size and only prints the trimming information when it is relevant (and more clearly). --- RetrieveSymbols/RetrieveSymbols.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/RetrieveSymbols/RetrieveSymbols.cpp b/RetrieveSymbols/RetrieveSymbols.cpp index d716aa25..56b6c2e5 100644 --- a/RetrieveSymbols/RetrieveSymbols.cpp +++ b/RetrieveSymbols/RetrieveSymbols.cpp @@ -122,9 +122,13 @@ int main(int argc, _Pre_readable_size_(argc) char* argv[]) } if (gText.size() != 32) { - printf("Error: PDB GUIDs must be exactly 32 characters" - " (%s was stripped to %s).\n", gTextArg.c_str(), gText.c_str()); - return 10; + if (gText == gTextArg) + printf("Error: PDB GUIDs must be exactly 32 characters, length of %s is %zu.", + gText.c_str(), gText.size()); + else + printf("Error: PDB GUIDs must be exactly 32 characters, length of %s (stripped from %s) is %zu.", + gText.c_str(), gTextArg.c_str(), gText.size()); + return 10; } int count = sscanf_s(gText.substr(0, 8).c_str(), "%x", &g.Data1);