From 8beab959b633e6641d07aba053a55e6e8e61eb00 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:58:00 -0300 Subject: targets, test-debugger, bench-debugger A linked list, a graph search in Zig, the same C under glibc and musl, two threads. The tests drive the debugger over them: breakpoint counts, the lines a step walks (as gdb), a list snapshotted by a hook, a watch's words, the syscalls that tell glibc from musl, threads, attach, and scripted dbg and record sessions. The bench measures steps, stops and memory access from bare ptrace up to a recording. Co-Authored-By: Claude Fable 5.2 --- targets/libc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 targets/libc.c (limited to 'targets/libc.c') diff --git a/targets/libc.c b/targets/libc.c new file mode 100644 index 0000000..2dad81b --- /dev/null +++ b/targets/libc.c @@ -0,0 +1,19 @@ +// The same C under two C libraries (glibc linked dynamically, musl +// statically): what startup, malloc and stdio turn into, seen as syscalls. +#include +#include +#include + +// Volatile, or the compiler proves the allocations away. +static char *volatile small, *volatile big; + +int main(void) { + small = malloc(64); + big = malloc(1 << 20); + strcpy(small, "small"); + memset(big, 'b', 1 << 20); + printf("%s %c\n", small, big[4096]); + free(big); + free(small); + return 0; +} -- cgit v1.3