diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h index b1aa85e1..091700a7 100644 --- a/src/common/windows/pdb_source_line_writer.h +++ b/src/common/windows/pdb_source_line_writer.h @@ -62,7 +62,7 @@ class PDBSourceLineWriter { ANY_FILE // try PDB_FILE and then EXE_FILE }; - explicit PDBSourceLineWriter(bool handle_inline); + explicit PDBSourceLineWriter(bool handle_inline = false); ~PDBSourceLineWriter(); // Opens the given file. For executable files, the corresponding pdb diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index e6fa126f..c774b0e7 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -116,8 +116,9 @@ static bool GetFileVersionString(const wchar_t* filename, wstring* version) { // and information about the pdb in pdb_info. static bool DumpSymbolsToTempFile(const wchar_t* file, wstring* temp_file_path, - PDBModuleInfo* pdb_info) { - google_breakpad::PDBSourceLineWriter writer; + PDBModuleInfo* pdb_info, + bool handle_inline) { + google_breakpad::PDBSourceLineWriter writer(handle_inline); // Use EXE_FILE to get information out of the exe/dll in addition to the // pdb. The name and version number of the exe/dll are of value, and // there's no way to locate an exe/dll given a pdb. @@ -247,9 +248,10 @@ static bool DoSymUploadV2( __declspec(noreturn) void printUsageAndExit() { wprintf(L"Usage:\n\n" - L" symupload [--timeout NN] [--product product_name] ^\n" + L" symupload [--i] [--timeout NN] [--product product_name] ^\n" L" ^\n" L" [...]\n\n"); + wprintf(L" - i: Extract inline information from pdb.\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" @@ -273,6 +275,7 @@ __declspec(noreturn) void printUsageAndExit() { int wmain(int argc, wchar_t* argv[]) { const wchar_t* module; const wchar_t* product = nullptr; + bool handle_inline = false; int timeout = -1; int currentarg = 1; bool use_sym_upload_v2 = false; @@ -280,6 +283,11 @@ int wmain(int argc, wchar_t* argv[]) { const wchar_t* api_url = nullptr; const wchar_t* api_key = nullptr; while (argc > currentarg + 1) { + if (!wcscmp(L"--i", argv[currentarg])) { + handle_inline = true; + ++currentarg; + continue; + } if (!wcscmp(L"--timeout", argv[currentarg])) { timeout = _wtoi(argv[currentarg + 1]); currentarg += 2; @@ -310,7 +318,7 @@ int wmain(int argc, wchar_t* argv[]) { wstring symbol_file; PDBModuleInfo pdb_info; - if (!DumpSymbolsToTempFile(module, &symbol_file, &pdb_info)) { + if (!DumpSymbolsToTempFile(module, &symbol_file, &pdb_info, handle_inline)) { fwprintf(stderr, L"Could not get symbol data from %s\n", module); return 1; }