[swift-inspect] full Android implementation including heap iteration

This commit is contained in:
Andrew Rogers
2024-11-11 15:06:05 -08:00
parent d2801ecee9
commit f981f35fb5
19 changed files with 661 additions and 5 deletions

View File

@@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#if defined(__cplusplus)
extern "C" {
#endif
#define HEAP_ITERATE_DATA_MAX_VALID_IDX 0
#define HEAP_ITERATE_DATA_NEXT_FREE_IDX 1
#define HEAP_ITERATE_DATA_HEADER_SIZE 2
#define HEAP_ITERATE_DATA_ENTRY_SIZE 2
typedef void (*heap_iterate_callback_t)(void* context, uint64_t base, uint64_t len);
bool heap_iterate(pid_t pid, void* callback_context, heap_iterate_callback_t callback);
void* heap_callback_start();
size_t heap_callback_len();
#if defined(__cplusplus)
}
#endif