Files
TheRock/compiler/amd-llvm/lldb/tools/debugserver/source/MacOSX/MachVMRegion.h
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

75 lines
2.5 KiB
C++

//===-- MachVMRegion.h ------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Created by Greg Clayton on 6/26/07.
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_MACHVMREGION_H
#define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_MACHVMREGION_H
#include "DNBDefs.h"
#include "DNBError.h"
#include <mach/mach.h>
class MachVMRegion {
public:
MachVMRegion(task_t task);
~MachVMRegion();
void Clear();
mach_vm_address_t StartAddress() const { return m_start; }
mach_vm_address_t EndAddress() const { return m_start + m_size; }
mach_vm_size_t GetByteSize() const { return m_size; }
mach_vm_address_t BytesRemaining(mach_vm_address_t addr) const {
if (ContainsAddress(addr))
return m_size - (addr - m_start);
else
return 0;
}
bool ContainsAddress(mach_vm_address_t addr) const {
return addr >= StartAddress() && addr < EndAddress();
}
bool SetProtections(mach_vm_address_t addr, mach_vm_size_t size,
vm_prot_t prot);
bool RestoreProtections();
bool GetRegionForAddress(nub_addr_t addr);
uint32_t GetDNBPermissions() const;
std::vector<std::string> GetFlags() const;
std::vector<std::string> GetMemoryTypes() const;
const DNBError &GetError() { return m_err; }
protected:
#if defined(VM_REGION_SUBMAP_SHORT_INFO_COUNT_64)
typedef vm_region_submap_short_info_data_64_t RegionInfo;
enum { kRegionInfoSize = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 };
#else
typedef vm_region_submap_info_data_64_t RegionInfo;
enum { kRegionInfoSize = VM_REGION_SUBMAP_INFO_COUNT_64 };
#endif
task_t m_task;
mach_vm_address_t m_addr;
DNBError m_err;
mach_vm_address_t m_start;
mach_vm_size_t m_size;
natural_t m_depth;
RegionInfo m_data;
vm_prot_t m_curr_protection; // The current, possibly modified protections.
// Original value is saved in m_data.protections.
mach_vm_address_t
m_protection_addr; // The start address at which protections were changed
mach_vm_size_t
m_protection_size; // The size of memory that had its protections changed
};
#endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_MACHVMREGION_H