From e469f8cf4bd12d0addb2f2a37962819a8644622b Mon Sep 17 00:00:00 2001 From: "ivanpe@chromium.org" Date: Mon, 17 Nov 2014 22:47:05 +0000 Subject: Add parameter --product to symupload.exe Adding an optional parameter --product to symupload.exe. If specified it will be passed to the symbol server as POST parameter 'product'. As part of this, I'm also fixing: - Removed the .vcproj file as it can be generated from the .gyp file on demand. - error C4335: Mac file format detected. Fixed the line endings for omap.cc and dia_util.cc. - warning C4003: not enough actual parameters for macro 'max' Symupload.exe was compiled using MSVS 2013 and DIA SDK 12.0. Review URL: https://breakpad.appspot.com/9734002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1402 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/tools/windows/binaries/symupload.exe | Bin 206336 -> 195072 bytes src/tools/windows/symupload/symupload.cc | 53 ++++-- src/tools/windows/symupload/symupload.vcproj | 251 --------------------------- 3 files changed, 40 insertions(+), 264 deletions(-) delete mode 100644 src/tools/windows/symupload/symupload.vcproj (limited to 'src/tools') diff --git a/src/tools/windows/binaries/symupload.exe b/src/tools/windows/binaries/symupload.exe index 097e4291..ba319b26 100644 Binary files a/src/tools/windows/binaries/symupload.exe and b/src/tools/windows/binaries/symupload.exe differ diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index eafd9b47..df4bb693 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -36,6 +36,7 @@ // debug_identifier: the debug file's identifier, usually consisting of // the guid and age embedded in the pdb, e.g. // "11111111BBBB3333DDDD555555555555F" +// product: the HTTP-friendly product name, e.g. "MyApp" // version: the file version of the module, e.g. "1.2.3.4" // os: the operating system that the module was built for, always // "windows" in this implementation. @@ -154,24 +155,36 @@ static bool DumpSymbolsToTempFile(const wchar_t *file, } __declspec(noreturn) void printUsageAndExit() { - wprintf(L"Usage: symupload [--timeout NN] " - L" [...]\n\n"); - wprintf(L"Timeout is in milliseconds, or can be 0 to be unlimited\n\n"); - wprintf(L"Example:\n\n\tsymupload.exe --timeout 0 chrome.dll " - L"http://no.free.symbol.server.for.you\n"); + wprintf(L"Usage:\n\n" + L" symupload [--timeout NN] [--product product_name] ^\n" + L" ^\n" + L" [...]\n\n"); + wprintf(L" - Timeout is in milliseconds, or can be 0 to be unlimited.\n"); + wprintf(L" - product_name is an HTTP-friendly product name. It must only\n" + L" contain an ascii subset: alphanumeric and punctuation.\n" + L" This string is case-sensitive.\n\n"); + wprintf(L"Example:\n\n" + L" symupload.exe --timeout 0 --product Chrome ^\n" + L" chrome.dll http://no.free.symbol.server.for.you\n"); exit(0); } int wmain(int argc, wchar_t *argv[]) { const wchar_t *module; + const wchar_t *product = nullptr; int timeout = -1; int currentarg = 1; - if (argc > 2) { - if (!wcscmp(L"--timeout", argv[1])) { - timeout = _wtoi(argv[2]); - currentarg = 3; + while (argc > currentarg + 1) { + if (!wcscmp(L"--timeout", argv[currentarg])) { + timeout = _wtoi(argv[currentarg + 1]); + currentarg += 2; + continue; } - } else { - printUsageAndExit(); + if (!wcscmp(L"--product", argv[currentarg])) { + product = argv[currentarg + 1]; + currentarg += 2; + continue; + } + break; } if (argc >= currentarg + 2) @@ -194,6 +207,17 @@ int wmain(int argc, wchar_t *argv[]) { parameters[L"debug_identifier"] = pdb_info.debug_identifier; parameters[L"os"] = L"windows"; // This version of symupload is Windows-only parameters[L"cpu"] = pdb_info.cpu; + + // Don't make a missing product name a hard error. Issue a warning and let + // the server decide whether to reject files without product name. + if (product) { + parameters[L"product"] = product; + } else { + fwprintf( + stderr, + L"Warning: No product name (flag --product) was specified for %s\n", + module); + } // Don't make a missing version a hard error. Issue a warning, and let the // server decide whether to reject files without versions. @@ -207,12 +231,15 @@ int wmain(int argc, wchar_t *argv[]) { bool success = true; while (currentarg < argc) { + int response_code; if (!HTTPUpload::SendRequest(argv[currentarg], parameters, symbol_file, L"symbol_file", timeout == -1 ? NULL : &timeout, - NULL, NULL)) { + nullptr, &response_code)) { success = false; - fwprintf(stderr, L"Symbol file upload to %s failed\n", argv[currentarg]); + fwprintf(stderr, + L"Symbol file upload to %s failed. Response code = %ld\n", + argv[currentarg], response_code); } currentarg++; } diff --git a/src/tools/windows/symupload/symupload.vcproj b/src/tools/windows/symupload/symupload.vcproj deleted file mode 100644 index 50f50b7c..00000000 --- a/src/tools/windows/symupload/symupload.vcproj +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.1