better debug support

This commit is contained in:
ed
2026-07-11 22:44:32 -04:00
parent 8b0fb1d4e4
commit aca6e30e20
8 changed files with 261 additions and 174 deletions
+13 -2
View File
@@ -321,11 +321,12 @@ function ps1-meta { param(
[Parameter(Mandatory=$true)][string[]]$sources,
[Parameter(Mandatory=$true)][string]$metadata,
[string]$out_root = (join-path $path_build 'gen'),
[string[]]$passes = @('--all')
[string[]]$passes = @('--all'),
[string[]]$extra_args = @()
)
$script = join-path $path_scripts 'ps1_meta.lua'
write-host "ps1-meta $($sources.Count) source(s), passes=$($passes -join ',')" ` -ForegroundColor Magenta
$arg_list = @($passes) + @('--metadata', $metadata) + @('--out-root', $out_root)
$arg_list = @($passes) + @('--metadata', $metadata) + @('--out-root', $out_root) + @($extra_args)
foreach ($s in $sources) { $arg_list += @('--source', $s) }
& luajit $script @arg_list
if ($LASTEXITCODE -ne 0) {
@@ -383,6 +384,16 @@ function build-gte_hello {
)
link-modules $link_modules $elf $link_args
make-binary $elf $exe
# Post-link: emit ONLY build/gen/gdb_tape_atoms_runtime.gdb. The per-source
# *.atoms.sourcemap.txt was already generated by the pre-link --all call,
# so we skip --atoms-source-map here to avoid re-doing the work. The
# gdb-runtime emission requires --elf (for nm-based address lookup) so it
# MUST happen post-link. ON by default per user pref 2026-07-11.
ps1-meta -sources $atom_sources -metadata $path_atom_metadata `
-out_root (join-path $path_build 'gen') `
-passes @('--gdb-runtime') `
-extra_args @('--elf', $elf)
}
build-gte_hello