From 19a07622bf56939b58f71618016f7140dddb7a00 Mon Sep 17 00:00:00 2001 From: Justin Moore Date: Thu, 17 Nov 2022 11:14:38 -0600 Subject: [PATCH] Add `DebugInformation::is_stripped` to easily query to see if the PDB is stripped --- src/dbi.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dbi.rs b/src/dbi.rs index ce21c70..d62ae98 100644 --- a/src/dbi.rs +++ b/src/dbi.rs @@ -88,6 +88,17 @@ impl<'s> DebugInformation<'s> { } } + /// Returns whether or not this PDB has been marked as stripped. Stripped PDBs do not contain + /// type information, line number information, or per-object CV symbols. + /// + /// This flag is set when a PDB is written with [/PDBSTRIPPED] by MSVC. + /// + /// [/PDBSTRIPPED]: https://learn.microsoft.com/en-us/cpp/build/reference/pdbstripped-strip-private-symbols?view=msvc-170 + pub fn is_stripped(&self) -> bool { + // flags.fStripped + (self.header.flags & 0x2) != 0 + } + /// Returns an iterator that can traverse the modules list in sequential order. pub fn modules(&self) -> Result> { let mut buf = self.stream.parse_buffer();