Skip to content

Commit

Permalink
Comment-out unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jul 6, 2023
1 parent 25bddbf commit 8b39122
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/symbolize/gimli/parse_running_mmaps_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ pub(super) struct MapsEntry {
/// x = execute
/// s = shared
/// p = private (copy on write)
perms: [u8; 4],
// perms: [u8; 4],
/// Offset into the file (or "whatever").
offset: usize,
// offset: usize,
/// device (major, minor)
dev: (usize, usize),
// dev: (usize, usize),
/// inode on the device. 0 indicates that no inode is associated with the memory region (e.g. uninitalized data aka BSS).
inode: usize,
// inode: usize,
/// Usually the file backing the mapping.
///
/// Note: The man page for proc includes a note about "coordination" by
Expand Down Expand Up @@ -102,28 +102,28 @@ impl FromStr for MapsEntry {
} else {
return Err("Couldn't parse address range");
};
let perms = if let &[r, w, x, p, ..] = perms_str.as_bytes() {
let _perms = if let &[r, w, x, p, ..] = perms_str.as_bytes() {
// If a system in the future adds a 5th field to the permission list,
// there's no reason to assume previous fields were invalidated.
[r, w, x, p]
} else {
return Err("less than 4 perms");
};
let offset = hex(offset_str)?;
let dev = if let Some((major, minor)) = dev_str.split_once(':') {
let _offset = hex(offset_str)?;
let _dev = if let Some((major, minor)) = dev_str.split_once(':') {
(hex(major)?, hex(minor)?)
} else {
return Err("Couldn't parse dev");
};
let inode = hex(inode_str)?;
let _inode = hex(inode_str)?;
let pathname = pathname_str.into();

Ok(MapsEntry {
address,
perms,
offset,
dev,
inode,
// perms,
// offset,
// dev,
// inode,
pathname,
})
}
Expand All @@ -140,10 +140,10 @@ fn check_maps_entry_parsing_64bit() {
.unwrap(),
MapsEntry {
address: (0xffffffffff600000, 0xffffffffff601000),
perms: *b"--xp",
offset: 0x00000000,
dev: (0x00, 0x00),
inode: 0x0,
// perms: *b"--xp",
// offset: 0x00000000,
// dev: (0x00, 0x00),
// inode: 0x0,
pathname: "[vsyscall]".into(),
}
);
Expand All @@ -155,10 +155,10 @@ fn check_maps_entry_parsing_64bit() {
.unwrap(),
MapsEntry {
address: (0x7f5985f46000, 0x7f5985f48000),
perms: *b"rw-p",
offset: 0x00039000,
dev: (0x103, 0x06),
inode: 0x76021795,
// perms: *b"rw-p",
// offset: 0x00039000,
// dev: (0x103, 0x06),
// inode: 0x76021795,
pathname: "/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2".into(),
}
);
Expand All @@ -168,10 +168,10 @@ fn check_maps_entry_parsing_64bit() {
.unwrap(),
MapsEntry {
address: (0x35b1a21000, 0x35b1a22000),
perms: *b"rw-p",
offset: 0x00000000,
dev: (0x00, 0x00),
inode: 0x0,
// perms: *b"rw-p",
// offset: 0x00000000,
// dev: (0x00, 0x00),
// inode: 0x0,
pathname: Default::default(),
}
);
Expand All @@ -192,10 +192,10 @@ fn check_maps_entry_parsing_32bit() {
.unwrap(),
MapsEntry {
address: (0x08056000, 0x08077000),
perms: *b"rw-p",
offset: 0x00000000,
dev: (0x00, 0x00),
inode: 0x0,
// perms: *b"rw-p",
// offset: 0x00000000,
// dev: (0x00, 0x00),
// inode: 0x0,
pathname: "[heap]".into(),
}
);
Expand All @@ -207,10 +207,10 @@ fn check_maps_entry_parsing_32bit() {
.unwrap(),
MapsEntry {
address: (0xb7c79000, 0xb7e02000),
perms: *b"r--p",
offset: 0x00000000,
dev: (0x08, 0x01),
inode: 0x60662705,
// perms: *b"r--p",
// offset: 0x00000000,
// dev: (0x08, 0x01),
// inode: 0x60662705,
pathname: "/usr/lib/locale/locale-archive".into(),
}
);
Expand All @@ -220,10 +220,10 @@ fn check_maps_entry_parsing_32bit() {
.unwrap(),
MapsEntry {
address: (0xb7e02000, 0xb7e03000),
perms: *b"rw-p",
offset: 0x00000000,
dev: (0x00, 0x00),
inode: 0x0,
// perms: *b"rw-p",
// offset: 0x00000000,
// dev: (0x00, 0x00),
// inode: 0x0,
pathname: Default::default(),
}
);
Expand Down

0 comments on commit 8b39122

Please sign in to comment.