mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
floor_watch.c takes up to twelve of the floor scan's survivors (the platform's rigid body controller unit first, then one per object at the pivot's height), watches them four at a time through the debug registers on every thread (platform.h plat_watch_set, Windows only), counts each access's call chain in a lock-free table and logs the chains with the executable's symbol names after each pass. prof_syms gains a callback form for that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
843 B
C
14 lines
843 B
C
#pragma once
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
// Writes `sym <address> <function>+0x<offset>` for each of the n addresses (any order, repeats allowed) that falls in
|
|
// the image loaded at base, from the COFF symbol table of the file at exe_path. Returns the lines written, -1 when the
|
|
// file has no symbol table or cannot be read.
|
|
int prof_syms_write(FILE *out, const char *exe_path, uint64_t base, const uint64_t *addr, size_t n);
|
|
// The same lookup with a callback in place of the lines: fn(ctx, address, function, offset) for each address named, in
|
|
// address order, once each. Returns the addresses named, -1 as above.
|
|
int prof_syms_each(const char *exe_path, uint64_t base, const uint64_t *addr, size_t n,
|
|
void (*fn)(void *ctx, uint64_t addr, const char *name, uint32_t offset), void *ctx);
|