Files
clang-p2996/lldb/tools/debugserver/source/MacOSX/MachVMMemory.h
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00

48 lines
1.7 KiB
C++

//===-- MachVMMemory.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 __MachVMMemory_h__
#define __MachVMMemory_h__
#include "DNBDefs.h"
#include "DNBError.h"
#include <mach/mach.h>
class MachVMMemory {
public:
MachVMMemory();
~MachVMMemory();
nub_size_t Read(task_t task, nub_addr_t address, void *data,
nub_size_t data_count);
nub_size_t Write(task_t task, nub_addr_t address, const void *data,
nub_size_t data_count);
nub_size_t PageSize(task_t task);
nub_bool_t GetMemoryRegionInfo(task_t task, nub_addr_t address,
DNBRegionInfo *region_info);
nub_bool_t GetMemoryProfile(DNBProfileDataScanType scanType, task_t task,
struct task_basic_info ti, cpu_type_t cputype,
nub_process_t pid, vm_statistics64_data_t &vminfo,
uint64_t &physical_memory, uint64_t &anonymous,
uint64_t &phys_footprint, uint64_t &memory_cap);
protected:
nub_size_t MaxBytesLeftInPage(task_t task, nub_addr_t addr, nub_size_t count);
nub_size_t WriteRegion(task_t task, const nub_addr_t address,
const void *data, const nub_size_t data_count);
vm_size_t m_page_size;
DNBError m_err;
};
#endif // #ifndef __MachVMMemory_h__