Skip to content

Commit 6c7e3ac

Browse files
Revert "Use a superpub field in MapsEntry"
This reverts commit 06ccd70.
1 parent 06ccd70 commit 6c7e3ac

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/symbolize/gimli/libs_dl_iterate_phdr.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ pub(super) fn native_libraries() -> Vec<Library> {
2020
fn infer_current_exe(base_addr: usize) -> OsString {
2121
if let Ok(entries) = super::parse_running_mmaps::parse_maps() {
2222
let opt_path = entries
23-
.into_iter()
24-
.find(|e| e.ip_matches(base_addr) && !e.pathname.is_empty())
25-
.map(|e| e.pathname);
23+
.iter()
24+
.find(|e| e.ip_matches(base_addr) && e.pathname().len() > 0)
25+
.map(|e| e.pathname())
26+
.cloned();
2627
if let Some(path) = opt_path {
2728
return path;
2829
}

src/symbolize/gimli/parse_running_mmaps_unix.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(super) struct MapsEntry {
5050
/// in general the pathname may be ambiguous. (I.e. you cannot tell if the
5151
/// denoted filename actually ended with the text "(deleted)", or if that
5252
/// was added by the maps rendering.
53-
pub(super) pathname: OsString,
53+
pathname: OsString,
5454
}
5555

5656
pub(super) fn parse_maps() -> Result<Vec<MapsEntry>, &'static str> {
@@ -70,6 +70,11 @@ pub(super) fn parse_maps() -> Result<Vec<MapsEntry>, &'static str> {
7070
}
7171

7272
impl MapsEntry {
73+
#[inline]
74+
pub(super) fn pathname(&self) -> &OsString {
75+
&self.pathname
76+
}
77+
7378
#[inline]
7479
pub(super) fn ip_matches(&self, ip: usize) -> bool {
7580
self.address.0 <= ip && ip < self.address.1

0 commit comments

Comments
 (0)