aboutsummaryrefslogtreecommitdiff
path: root/src/google_airbag
diff options
context:
space:
mode:
Diffstat (limited to 'src/google_airbag')
-rw-r--r--src/google_airbag/common/minidump_format.h17
-rw-r--r--src/google_airbag/processor/minidump.h30
2 files changed, 38 insertions, 9 deletions
diff --git a/src/google_airbag/common/minidump_format.h b/src/google_airbag/common/minidump_format.h
index 977cbc3c..535a6626 100644
--- a/src/google_airbag/common/minidump_format.h
+++ b/src/google_airbag/common/minidump_format.h
@@ -590,6 +590,23 @@ typedef struct {
#define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */
+/* In addition to the two CodeView record formats above, used for linking
+ * to external pdb files, it is possible for debugging data to be carried
+ * directly in the CodeView record itself. These signature values will
+ * be found in the first 4 bytes of the CodeView record. Additional values
+ * not commonly experienced in the wild are given by "Microsoft Symbol and
+ * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section
+ * 7.2. An in-depth description of the CodeView 4.1 format is given by
+ * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/
+ * Microsoft Symbol File Internals/CodeView Subsections,
+ * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-support.pdf
+ */
+#define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */
+#define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0,
+ * MS C7-format (/Z7). */
+
+#define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */
+
/* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows
* structure is actually defined in WinNT.h. This structure is effectively
* obsolete with modules built by recent toolchains. */
diff --git a/src/google_airbag/processor/minidump.h b/src/google_airbag/processor/minidump.h
index f2700119..6aa87c21 100644
--- a/src/google_airbag/processor/minidump.h
+++ b/src/google_airbag/processor/minidump.h
@@ -369,15 +369,22 @@ class MinidumpModule : public MinidumpObject,
// The CodeView record, which contains information to locate the module's
// debugging information (pdb). This is returned as u_int8_t* because
- // the data can be one of two types: MDCVInfoPDB20* or MDCVInfoPDB70*.
- // Check the record's signature in the first four bytes to differentiate.
- // Current toolchains generate modules which carry MDCVInfoPDB70.
- const u_int8_t* GetCVRecord();
+ // the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be
+ // of a type unknown to Airbag, in which case the raw data will still be
+ // returned but no byte-swapping will have been performed. Check the
+ // record's signature in the first four bytes to differentiate between
+ // the various types. Current toolchains generate modules which carry
+ // MDCVInfoPDB70 by default. Returns a pointer to the CodeView record on
+ // success, and NULL on failure. On success, the optional |size| argument
+ // is set to the size of the CodeView record.
+ const u_int8_t* GetCVRecord(u_int32_t* size);
// The miscellaneous debug record, which is obsolete. Current toolchains
// do not generate this type of debugging information (dbg), and this
- // field is not expected to be present.
- const MDImageDebugMisc* GetMiscRecord();
+ // field is not expected to be present. Returns a pointer to the debugging
+ // record on success, and NULL on failure. On success, the optional |size|
+ // argument is set to the size of the debugging record.
+ const MDImageDebugMisc* GetMiscRecord(u_int32_t* size);
// Print a human-readable representation of the object to stdout.
void Print();
@@ -414,11 +421,16 @@ class MinidumpModule : public MinidumpObject,
const string* name_;
// Cached CodeView record - this is MDCVInfoPDB20 or (likely)
- // MDCVInfoPDB70. Stored as a u_int8_t because the structure contains
- // a variable-sized string and its exact size cannot be known until it
- // is processed.
+ // MDCVInfoPDB70, or possibly something else entirely. Stored as a u_int8_t
+ // because the structure contains a variable-sized string and its exact
+ // size cannot be known until it is processed.
vector<u_int8_t>* cv_record_;
+ // If cv_record_ is present, cv_record_signature_ contains a copy of the
+ // CodeView record's first four bytes, for ease of determinining the
+ // type of structure that cv_record_ contains.
+ u_int32_t cv_record_signature_;
+
// Cached MDImageDebugMisc (usually not present), stored as u_int8_t
// because the structure contains a variable-sized string and its exact
// size cannot be known until it is processed.