mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:05:08 +00:00
pmap: Add support for 64-bit addresses
This commit is contained in:
parent
98f8ecd9d2
commit
ce123c3b7f
1 changed files with 10 additions and 2 deletions
|
@ -55,12 +55,16 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
Vector<JsonValue> sorted_regions = json.value().as_array().values();
|
Vector<JsonValue> sorted_regions = json.value().as_array().values();
|
||||||
quick_sort(sorted_regions, [](auto& a, auto& b) {
|
quick_sort(sorted_regions, [](auto& a, auto& b) {
|
||||||
return a.as_object().get("address").to_u32() < b.as_object().get("address").to_u32();
|
return a.as_object().get("address").to_u64() < b.as_object().get("address").to_u64();
|
||||||
});
|
});
|
||||||
|
|
||||||
for (auto& value : sorted_regions) {
|
for (auto& value : sorted_regions) {
|
||||||
auto& map = value.as_object();
|
auto& map = value.as_object();
|
||||||
auto address = map.get("address").to_uint();
|
#if ARCH(I386)
|
||||||
|
auto address = map.get("address").to_u32();
|
||||||
|
#else
|
||||||
|
auto address = map.get("address").to_u64();
|
||||||
|
#endif
|
||||||
auto size = map.get("size").to_string();
|
auto size = map.get("size").to_string();
|
||||||
|
|
||||||
auto access = String::formatted("{}{}{}{}{}",
|
auto access = String::formatted("{}{}{}{}{}",
|
||||||
|
@ -70,7 +74,11 @@ int main(int argc, char** argv)
|
||||||
(map.get("shared").to_bool() ? "s" : "-"),
|
(map.get("shared").to_bool() ? "s" : "-"),
|
||||||
(map.get("syscall").to_bool() ? "c" : "-"));
|
(map.get("syscall").to_bool() ? "c" : "-"));
|
||||||
|
|
||||||
|
#if ARCH(I386)
|
||||||
out("{:08x} ", address);
|
out("{:08x} ", address);
|
||||||
|
#else
|
||||||
|
out("{:16x} ", address);
|
||||||
|
#endif
|
||||||
out("{:>10} ", size);
|
out("{:>10} ", size);
|
||||||
if (extended) {
|
if (extended) {
|
||||||
auto resident = map.get("amount_resident").to_string();
|
auto resident = map.get("amount_resident").to_string();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue