Files
NX2navi/runtime/prof_syms.h
chrg6 cae09a2bcd Add floor_watch: hardware watchpoints on the floor the scan finds log which game code reads and writes it, at 60 fps and again at 120 fps or more.
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>
2026-11-13 07:08:49 -05:00

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);