Add symbol type option to SymUploadV2ProtocolSend.

Change-Id: Ia2eadae56c7f879ddb2212e4018024a5c04634aa
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3670054
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
Nelson Billing
2022-05-31 14:04:53 -07:00
parent bee636cea4
commit 678d69cd78
6 changed files with 41 additions and 15 deletions

View File

@@ -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(),

View File

@@ -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();
}