aboutsummaryrefslogtreecommitdiff
path: root/src/tools/windows/symupload/symupload.cc
diff options
context:
space:
mode:
authorivanpe@chromium.org <ivanpe@chromium.org>2014-11-17 22:47:05 +0000
committerivanpe@chromium.org <ivanpe@chromium.org>2014-11-17 22:47:05 +0000
commite469f8cf4bd12d0addb2f2a37962819a8644622b (patch)
tree04be3a8f852e57422ace44a1360b2d4d5b272cc0 /src/tools/windows/symupload/symupload.cc
parentFix UMR and potential crash in Mac dump_syms. (diff)
downloadbreakpad-e469f8cf4bd12d0addb2f2a37962819a8644622b.tar.xz
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
Diffstat (limited to 'src/tools/windows/symupload/symupload.cc')
-rw-r--r--src/tools/windows/symupload/symupload.cc53
1 files changed, 40 insertions, 13 deletions
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] <file.exe|file.dll> "
- L"<symbol upload URL> [...<symbol upload URLs>]\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" <file.exe|file.dll> <symbol upload URL> ^\n"
+ L" [...<symbol upload URLs>]\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++;
}