Skip to content

Commit af98145

Browse files
committed
Minor style tweaks for gimli
1 parent 2781711 commit af98145

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/symbolize/gimli.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ pub unsafe fn resolve(what: ResolveWhat, cb: &mut FnMut(&super::Symbol)) {
233233
// Finally, get a cached mapping or create a new mapping for this file, and
234234
// evaluate the DWARF info to find the file/line/name for this address.
235235
with_mapping_for_path(path, |dwarf, symbols| {
236-
let mut found_sym = false;
237236
if let Ok(mut frames) = dwarf.find_frames(addr.0 as u64) {
238237
while let Ok(Some(frame)) = frames.next() {
239238
let name = frame.function.as_ref().and_then(|f| f.raw_name().ok());
@@ -245,21 +244,21 @@ pub unsafe fn resolve(what: ResolveWhat, cb: &mut FnMut(&super::Symbol)) {
245244
name,
246245
},
247246
});
248-
found_sym = true;
249247
}
250248
}
249+
if cb.called {
250+
return;
251+
}
251252

252253
// No DWARF info found, so fallback to the symbol table.
253-
if !found_sym {
254-
if let Some(name) = symbols.get(addr.0 as u64).and_then(|x| x.name()) {
255-
let sym = super::Symbol {
256-
inner: Symbol::Symbol {
257-
addr: addr.0 as usize as *mut c_void,
258-
name: name.as_bytes(),
259-
},
260-
};
261-
cb.call(&sym);
262-
}
254+
if let Some(name) = symbols.get(addr.0 as u64).and_then(|x| x.name()) {
255+
let sym = super::Symbol {
256+
inner: Symbol::Symbol {
257+
addr: addr.0 as usize as *mut c_void,
258+
name: name.as_bytes(),
259+
},
260+
};
261+
cb.call(&sym);
263262
}
264263
});
265264

0 commit comments

Comments
 (0)