Skip to content

Commit 4cb6f4f

Browse files
committed
dwarf dump: Better support for GCC/ProDG & various fixes
- Displays subroutine "static" and "inline" if present - Displays subroutine labels, blocks and inlines if present - Displays struct member visibility if present - Skips tags that can't be processed rather than bailing
1 parent 5128ff6 commit 4cb6f4f

File tree

2 files changed

+433
-19
lines changed

2 files changed

+433
-19
lines changed

src/cmd/dwarf.rs

+34-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,43 @@ where
178178
let children = tag.children(&tags);
179179
let mut typedefs = BTreeMap::<u32, Vec<u32>>::new();
180180
for child in children {
181-
let tag_type = process_root_tag(&tags, child)?;
181+
let tag_type = match process_root_tag(&tags, child) {
182+
Ok(tag_type) => tag_type,
183+
Err(e) => {
184+
log::error!(
185+
"Failed to process tag {} (unit {}): {}",
186+
child.key,
187+
unit,
188+
e
189+
);
190+
writeln!(
191+
w,
192+
"// ERROR: Failed to process tag {} ({:?})",
193+
child.key, child.kind
194+
)?;
195+
continue;
196+
}
197+
};
182198
if should_skip_tag(&tag_type) {
183199
continue;
184200
}
185-
writeln!(w, "{}", tag_type_string(&tags, &typedefs, &tag_type)?)?;
201+
match tag_type_string(&tags, &typedefs, &tag_type) {
202+
Ok(s) => writeln!(w, "{}", s)?,
203+
Err(e) => {
204+
log::error!(
205+
"Failed to emit tag {} (unit {}): {}",
206+
child.key,
207+
unit,
208+
e
209+
);
210+
writeln!(
211+
w,
212+
"// ERROR: Failed to emit tag {} ({:?})",
213+
child.key, child.kind
214+
)?;
215+
continue;
216+
}
217+
}
186218

187219
if let TagKind::Typedef = child.kind {
188220
// TODO fundamental typedefs?

0 commit comments

Comments
 (0)