feat(selfhost): multi-file #line paths from Decl.sourceFile

Stamp each merged .bux path onto decls, propagate to HirFunc, and emit
#line N \"path\" per function without requiring BUX_DEBUG_FILE.

- Decl.sourceFile + Cli_StampSourceFile on merge/project parse
- HirFunc.sourceFile; CBE switches currentFile per function
- Stdlib and multi-file user packages get distinct paths automatically
This commit is contained in:
2026-07-19 23:13:02 +03:00
parent ed07cf8921
commit 70321075a6
7 changed files with 75 additions and 10 deletions
+5 -4
View File
@@ -148,13 +148,14 @@ make bench-nexus # wrk throughput vs apps/nexus /api/health
```bash
./buxc build # -O0 -g, #line → .bux (gdb-friendly; bootstrap)
./buxc build --release # -O2 -DNDEBUG, no #line / -g
# Selfhost (buxc2): same --release / default -O0 -g; #line via HIR line numbers
export BUX_DEBUG_FILE=src/Main.bux # path embedded in #line (selfhost)
# Selfhost (buxc2): default -O0 -g; multi-file #line from Decl.sourceFile
# (stdlib + each src/*.bux get their own path — no env needed)
export BUX_NO_LINE=1 # disable selfhost #line maps
export BUX_CFLAGS="-fno-omit-frame-pointer" # optional extra cc flags
export BUX_DEBUG_FILE=/abs/path.bux # optional: force all #line to one path
export BUX_CFLAGS="-fno-omit-frame-pointer"
gdb --args ./build/myapp
# (gdb) break Main
# (gdb) list # Bux source via #line
# (gdb) list # Bux source via #line (correct file per function)
```