diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc index 4481cc25..bcc1a1a9 100644 --- a/src/common/windows/sym_upload_v2_protocol.cc +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -20,6 +20,7 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, const wstring& debug_file, const wstring& debug_id, const wstring& symbol_filename, + const wstring& symbol_type, bool force) { wstring url(api_url); wstring key(api_key); @@ -69,7 +70,7 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, CompleteUploadResult completeUploadResult = SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, - debug_file, debug_id); + debug_file, debug_id, symbol_type); if (completeUploadResult == CompleteUploadResult::Error) { wprintf(L"Failed to complete upload.\n"); return false; diff --git a/src/common/windows/sym_upload_v2_protocol.h b/src/common/windows/sym_upload_v2_protocol.h index 24f31f2c..389fa586 100644 --- a/src/common/windows/sym_upload_v2_protocol.h +++ b/src/common/windows/sym_upload_v2_protocol.h @@ -37,14 +37,26 @@ namespace google_breakpad { // Sends file at |symbol_filename| using the sym-upload-v2 protocol to // |api_url| using key |api_key|, and using identifiers |debug_file| and // |debug_id|. |timeout_ms| is the number of milliseconds to wait before -// terminating the upload attempt. If |force| is set then it will overwrite an -// existing file with the same |debug_file| and |debug_id| in the store. +// terminating the upload attempt. |symbol_type| is the type of the symbol +// file, which is one of: +// "BREAKPAD" +// "ELF" +// "PE" +// "MACHO" +// "DEBUG_ONLY" +// "DWP" +// "DSYM" +// "PDB" +// "SOURCE_MAP" +// If |force| is set then it will overwrite an existing file with the +// same |debug_file| and |debug_id| in the store. bool SymUploadV2ProtocolSend(const wchar_t* api_url, const wchar_t* api_key, int* timeout_ms, const std::wstring& debug_file, const std::wstring& debug_id, const std::wstring& symbol_filename, + const std::wstring& symbol_type, bool force); } // namespace google_breakpad diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 558a97b9..0831b22c 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -70,15 +70,23 @@ namespace google_breakpad { int* timeout_ms, const wstring& upload_key, const wstring& debug_file, - const wstring& debug_id) { + const wstring& debug_id, + const wstring& type) { wstring url = api_url + L"/v1/uploads/" + upload_key + L":complete" L"?key=" + api_key; wstring body = L"{ symbol_id: {" - L"debug_file: \"" + debug_file + L"\", " - L"debug_id: \"" + debug_id + L"\" " + L"debug_file: \"" + + debug_file + + L"\", " + L"debug_id: \"" + + debug_id + + L"\" " L"}, " + L"symbol_upload_type: \"" + + type + + L"\", " L"use_async_processing: true }"; wstring response; int response_code; diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h index 4a85c052..bdf9f7cb 100644 --- a/src/common/windows/symbol_collector_client.h +++ b/src/common/windows/symbol_collector_client.h @@ -69,13 +69,13 @@ namespace google_breakpad { // Notify the API that symbol file upload is finished and its contents // are ready to be read and/or used for further processing. - static CompleteUploadResult CompleteUpload( - wstring& api_url, - wstring& api_key, - int* timeout_ms, - const wstring& upload_key, - const wstring& debug_file, - const wstring& debug_id); + static CompleteUploadResult CompleteUpload(wstring& api_url, + wstring& api_key, + int* timeout_ms, + const wstring& upload_key, + const wstring& debug_file, + const wstring& debug_id, + const wstring& type); // Returns whether or not a symbol file corresponding to the debug_file/ // debug_id pair is already present in symbol storage. diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index d1984eda..e150fc4d 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -66,6 +66,7 @@ using google_breakpad::WindowsStringUtils; const char* kMissingStringDelimiters = "|"; const char* kLocalCachePath = "c:\\symbols"; const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; +const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; // Windows stdio doesn't do line buffering. Use this function to flush after // writing to stdout and stderr so that a log will be available if the @@ -239,7 +240,8 @@ static bool UploadSymbolFile(const wstring& upload_symbol_url, FprintfFlush(stderr, "Uploading %s\n", converted_file.c_str()); if (!google_breakpad::SymUploadV2ProtocolSend( upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, - debug_id_w, converted_file_w, true)) { + debug_id_w, converted_file_w, kSymbolUploadTypeBreakpad, + /*force=*/true)) { FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed " "for %s %s %s\n", missing_info.debug_file.c_str(), diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 6d534e41..6c1d1981 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -68,6 +68,8 @@ using std::string; using std::vector; using std::wstring; +const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; + // Extracts the file version information for the given filename, // as a string, for example, "1.2.3.4". Returns true on success. static bool GetFileVersionString(const wchar_t* filename, wstring* version) { @@ -251,7 +253,8 @@ int wmain(int argc, wchar_t* argv[]) { success = google_breakpad::SymUploadV2ProtocolSend( api_url, api_key, timeout == -1 ? nullptr : &timeout, - pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, force); + pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, + kSymbolUploadTypeBreakpad, force); } else { printUsageAndExit(); }