From 12b22e8e484da84deec1aa5ae46280960c4e8eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 14 Feb 2025 11:13:28 +0100 Subject: [PATCH] strace: mapping type handler for _kern_map_file() Change-Id: I1f315c285668221fb9ff15165c81dfcd753d7df8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8977 Reviewed-by: waddlesplash --- src/bin/debug/strace/area.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/debug/strace/area.cpp b/src/bin/debug/strace/area.cpp index 63680f4f8a..88c41d427a 100644 --- a/src/bin/debug/strace/area.cpp +++ b/src/bin/debug/strace/area.cpp @@ -49,8 +49,16 @@ static const enum_info kAddressSpecs[] = { }; +static const enum_info kAreaMappings[] = { + ENUM_INFO_ENTRY(REGION_NO_PRIVATE_MAP), + ENUM_INFO_ENTRY(REGION_PRIVATE_MAP), + + { 0, NULL } +}; + static FlagsTypeHandler::FlagsList kAreaProtectionFlags; static EnumTypeHandler::EnumMap kAddressSpecsMap; +static EnumTypeHandler::EnumMap kAreaMappingMap; void @@ -62,6 +70,9 @@ patch_area() for (int i = 0; kAddressSpecs[i].name != NULL; i++) { kAddressSpecsMap[kAddressSpecs[i].index] = kAddressSpecs[i].name; } + for (int i = 0; kAreaMappings[i].name != NULL; i++) { + kAreaMappingMap[kAreaMappings[i].index] = kAreaMappings[i].name; + } Syscall *create = get_syscall("_kern_create_area"); create->GetParameter("address")->SetInOut(true); @@ -97,6 +108,8 @@ patch_area() new EnumTypeHandler(kAddressSpecsMap)); map_file->GetParameter("protection")->SetHandler( new FlagsTypeHandler(kAreaProtectionFlags)); + map_file->GetParameter("mapping")->SetHandler( + new EnumTypeHandler(kAreaMappingMap)); Syscall *set_memory_protection = get_syscall("_kern_set_memory_protection"); set_memory_protection->GetParameter("protection")->SetHandler(