aboutsummaryrefslogtreecommitdiff
path: root/src/common/windows/pdb_source_line_writer.h
diff options
context:
space:
mode:
authorivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-04-10 17:54:52 +0000
committerivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-04-10 17:54:52 +0000
commit6b0703a0932398d4ceb666315d29528f4705597e (patch)
treeadda38fe3907463cf93d9842cc976fcd7026960c /src/common/windows/pdb_source_line_writer.h
parentMoving directory 'build' one level up as it collides with a file named 'BUILD... (diff)
downloadbreakpad-6b0703a0932398d4ceb666315d29528f4705597e.tar.xz
Adding support for 64-bit Windows modules to ms_symbol_server_converter.
As part of that: - Updated MSSymbolServerConverter to also download the executable files from the symbol server and pass them to the PDBSourceLineWriter as it is required for successful conversion of symbols for 64-bit modules. - Added a .gyp file and target for the ms_symbol_server_converter library. - Updated PDBSourceLineWriter to allow executable files to be in locations different from the locations of the PDB files. - Minor style issue: * #define guards. * No space before ')' and after '('. R=mark@chromium.org, wfh@chromium.org Review URL: https://breakpad.appspot.com/1434002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1309 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/windows/pdb_source_line_writer.h')
-rw-r--r--src/common/windows/pdb_source_line_writer.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h
index d928a607..9aeb2a44 100644
--- a/src/common/windows/pdb_source_line_writer.h
+++ b/src/common/windows/pdb_source_line_writer.h
@@ -30,8 +30,8 @@
// PDBSourceLineWriter uses a pdb file produced by Visual C++ to output
// a line/address map for use with BasicSourceLineResolver.
-#ifndef _PDB_SOURCE_LINE_WRITER_H__
-#define _PDB_SOURCE_LINE_WRITER_H__
+#ifndef COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_
+#define COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_
#include <atlcomcli.h>
@@ -101,10 +101,14 @@ class PDBSourceLineWriter {
// Returns true on success.
bool Open(const wstring &file, FileFormat format);
- // Locates the pdb file for the given executable (exe or dll) file,
- // and opens it. If there is already a pdb file open, it is automatically
- // closed. Returns true on success.
- bool OpenExecutable(const wstring &exe_file);
+ // Sets the code file full path. This is optional for 32-bit modules. It is
+ // also optional for 64-bit modules when there is an executable file stored
+ // in the same directory as the PDB file. It is only required for 64-bit
+ // modules when the executable file is not in the same location as the PDB
+ // file and it must be called after Open() and before WriteMap().
+ // If Open() was called for an executable file, then it is an error to call
+ // SetCodeFile() with a different file path and it will return false.
+ bool SetCodeFile(const wstring &exe_file);
// Writes a map file from the current pdb file to the given file stream.
// Returns true on success.
@@ -179,12 +183,12 @@ class PDBSourceLineWriter {
// and an ID is stored for it, or false if it has not.
bool FileIDIsCached(const wstring &file) {
return unique_files_.find(file) != unique_files_.end();
- };
+ }
// Cache this filename and ID for later reuse.
void CacheFileID(const wstring &file, DWORD id) {
unique_files_[file] = id;
- };
+ }
// Store this ID in the cache as a duplicate for this filename.
void StoreDuplicateFileID(const wstring &file, DWORD id) {
@@ -193,7 +197,7 @@ class PDBSourceLineWriter {
// map this id to the previously seen one
file_ids_[id] = iter->second;
}
- };
+ }
// Given a file's unique ID, return the ID that should be used to
// reference it. There may be multiple files with identical filenames
@@ -204,7 +208,7 @@ class PDBSourceLineWriter {
if (iter == file_ids_.end())
return id;
return iter->second;
- };
+ }
// Find the PE file corresponding to the loaded PDB file, and
// set the code_file_ member. Returns false on failure.
@@ -250,4 +254,4 @@ class PDBSourceLineWriter {
} // namespace google_breakpad
-#endif // _PDB_SOURCE_LINE_WRITER_H__
+#endif // COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_