Skip to content

Commit 39ad276

Browse files
Revert "Use a superpub field in MapsEntry"
This reverts commit 06ccd70.
1 parent 491ea5b commit 39ad276

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/symbolize/gimli/libs_dl_iterate_phdr.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ fn infer_current_exe(
3636
#[cfg(not(target_os = "hurd"))]
3737
if let Some(entries) = maps {
3838
let opt_path = entries
39-
.into_iter()
40-
.find(|e| e.ip_matches(base_addr) && !e.pathname.is_empty())
41-
.map(|e| e.pathname);
39+
.iter()
40+
.find(|e| e.ip_matches(base_addr) && e.pathname().len() > 0)
41+
.map(|e| e.pathname())
42+
.cloned();
4243
if let Some(path) = opt_path {
4344
return path;
4445
}

src/symbolize/gimli/parse_running_mmaps_unix.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(super) struct MapsEntry {
5252
/// in general the pathname may be ambiguous. (I.e. you cannot tell if the
5353
/// denoted filename actually ended with the text "(deleted)", or if that
5454
/// was added by the maps rendering.
55-
pub(super) pathname: OsString,
55+
pathname: OsString,
5656
}
5757

5858
pub(super) fn parse_maps() -> Result<Vec<MapsEntry>, &'static str> {
@@ -72,6 +72,11 @@ pub(super) fn parse_maps() -> Result<Vec<MapsEntry>, &'static str> {
7272
}
7373

7474
impl MapsEntry {
75+
#[inline]
76+
pub(super) fn pathname(&self) -> &OsString {
77+
&self.pathname
78+
}
79+
7580
#[inline]
7681
pub(super) fn ip_matches(&self, ip: usize) -> bool {
7782
self.address.0 <= ip && ip < self.address.1

0 commit comments

Comments
 (0)