diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-11-06 19:34:19 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-11-06 19:34:19 +0000 |
commit | 80866e79454cefc5570b01dbb0a723185eae653c (patch) | |
tree | b7aaf22c6d808a23a66756fc99d50d3fab44a695 /src/tools/windows/symupload | |
parent | Fix minor naming inconsistency (#67). r=mmentovai (diff) | |
download | breakpad-80866e79454cefc5570b01dbb0a723185eae653c.tar.xz |
Symbol file should contain module GUID at beginning (#66). r=bryner
- The dumped symbol format now begins with a MODULE line identifying the
uuid, age, and name of the source pdb file.
- The processor ignores MODULE lines, but they are useful in figuring out
how to index symbol files in a symbol store.
- dump_syms and symupload now both accept either a pdb or exe/dll and
will read the pdb regardless.
- Figured out that MSSS always represents a module's age in pathnames in
hexadecimal, and updated SimpleSymbolSupplier to match.
http://groups.google.com/group/airbag-dev/browse_thread/thread/572108d6567edd58
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@59 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/tools/windows/symupload')
-rw-r--r-- | src/tools/windows/symupload/symupload.cc | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index b528c322..33f8e51f 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -95,11 +95,13 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) { // Creates a new temporary file and writes the symbol data from the given // exe/dll file to it. Returns the path to the temp file in temp_file_path, // and the unique identifier (GUID) for the pdb in module_guid. -static bool DumpSymbolsToTempFile(const wchar_t *exe_file, +static bool DumpSymbolsToTempFile(const wchar_t *file, wstring *temp_file_path, - wstring *module_guid) { + wstring *module_guid, + int *module_age, + wstring *module_filename) { google_airbag::PDBSourceLineWriter writer; - if (!writer.Open(exe_file, PDBSourceLineWriter::EXE_FILE)) { + if (!writer.Open(file, PDBSourceLineWriter::ANY_FILE)) { return false; } @@ -126,37 +128,33 @@ static bool DumpSymbolsToTempFile(const wchar_t *exe_file, } *temp_file_path = temp_filename; - *module_guid = writer.GetModuleGUID(); - return true; -} -// Returns the base name of a file, e.g. strips off the path. -static wstring GetBaseName(const wstring &filename) { - wstring base_name(filename); - size_t slash_pos = base_name.find_last_of(L"/\\"); - if (slash_pos != string::npos) { - base_name.erase(0, slash_pos + 1); - } - return base_name; + return writer.GetModuleInfo(module_guid, module_age, module_filename); } int wmain(int argc, wchar_t *argv[]) { if (argc < 3) { - wprintf(L"Usage: %s file.[exe|dll] <symbol upload URL>\n", argv[0]); + wprintf(L"Usage: %s file.[pdb|exe|dll] <symbol upload URL>\n", argv[0]); return 0; } const wchar_t *module = argv[1], *url = argv[2]; - wstring module_basename = GetBaseName(module); - wstring symbol_file, module_guid; - if (!DumpSymbolsToTempFile(module, &symbol_file, &module_guid)) { + wstring symbol_file, module_guid, module_basename; + int module_age; + if (!DumpSymbolsToTempFile(module, &symbol_file, + &module_guid, &module_age, &module_basename)) { fwprintf(stderr, L"Could not get symbol data from %s\n", module); return 1; } + wchar_t module_age_string[11]; + _snwprintf_s(module_age_string, sizeof(module_age_string) / sizeof(wchar_t), + _TRUNCATE, L"0x%x", module_age); + map<wstring, wstring> parameters; parameters[L"module"] = module_basename; parameters[L"guid"] = module_guid; + parameters[L"age"] = module_age_string; // Don't make a missing version a hard error. Issue a warning, and let the // server decide whether to reject files without versions. |