5635
This commit is contained in:
parent
1fafe7afe3
commit
571bf69fbc
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
# Translate SubX files with debug information.
|
||||
#
|
||||
# Mu's core tooling has a gap:
|
||||
# 1. 'translate' can generate debug information, but syntax sugar passes
|
||||
# (sigils and calls) have no C++ versions and take several minutes to run
|
||||
# emulated.
|
||||
# 2. 'ntranslate' is fast, but you get no trace for runs and zero error-checking
|
||||
# on the code emitted by sigils and calls. Which could still be buggy.
|
||||
#
|
||||
# This script is a hack to get the best of both worlds. We run natively what
|
||||
# we must, and leverage as much debug information as possible. This arrangement
|
||||
# is snappy but requires Linux just like 'ntranslate'. You also are on your
|
||||
# own to mentally map desugared instructions in traces and error messages back
|
||||
# to the original sources.
|
||||
|
||||
set -e
|
||||
|
||||
echo " calls"
|
||||
cat $* |apps/calls > a.calls
|
||||
echo " sigils"
|
||||
cat a.calls |apps/sigils > a.sigils
|
||||
|
||||
subx --debug translate a.sigils -o a.elf
|
||||
|
||||
chmod +x a.elf
|
14
ntranslate
14
ntranslate
|
@ -2,13 +2,17 @@
|
|||
# Translate SubX using the self-hosted translator.
|
||||
#
|
||||
# Possible knobs:
|
||||
# Whether to run a phase directly or emulated.
|
||||
# Whether to run a phase natively or in emulated mode.
|
||||
# This script is for running natively.
|
||||
# Whether to stop after a phase.
|
||||
# Just always run all phases, but print out phases so it's clear where an error happens.
|
||||
# Whether to trace a phase. Whether to always trace or rerun with tracing enabled after an error.
|
||||
# Leave tracing to other scripts. We save intermediate files so it's easy to rerun a single phase afterwards.
|
||||
# Whether to run a phase with debug information. (Need to juggle multiple sets of debug files.)
|
||||
# This script assumes inputs are already working so doesn't easily show
|
||||
# which phase an error happens in.
|
||||
# Whether to trace a phase. Whether to always trace or rerun with tracing
|
||||
# enabled after an error.
|
||||
# Leave tracing to other scripts. We save intermediate files so it's easy
|
||||
# to rerun a single phase afterwards.
|
||||
# Whether to run a phase with debug information. (Need to juggle multiple
|
||||
# sets of debug files.)
|
||||
# Again, that's for subsequent scripts.
|
||||
|
||||
set -e
|
||||
|
|
14
translate
14
translate
|
@ -2,13 +2,17 @@
|
|||
# Translate SubX using the self-hosted translator.
|
||||
#
|
||||
# Possible knobs:
|
||||
# Whether to run a phase directly or emulated.
|
||||
# Whether to run a phase natively or in emulated mode.
|
||||
# Just always emulate for now since we debug on non-Linux.
|
||||
# Whether to stop after a phase.
|
||||
# Just always run all phases, but print out phases so it's clear where an error happens.
|
||||
# Whether to trace a phase. Whether to always trace or rerun with tracing enabled after an error.
|
||||
# Leave tracing to other scripts. We save intermediate files so it's easy to rerun a single phase afterwards.
|
||||
# Whether to run a phase with debug information. (Need to juggle multiple sets of debug files.)
|
||||
# Just always run all phases, but print out phases so it's clear where an
|
||||
# error happens.
|
||||
# Whether to trace a phase. Whether to always trace or rerun with tracing
|
||||
# enabled after an error.
|
||||
# Leave tracing to other scripts. We save intermediate files so it's easy
|
||||
# to rerun a single phase afterwards.
|
||||
# Whether to run a phase with debug information. (Need to juggle multiple
|
||||
# sets of debug files.)
|
||||
# Again, that's for subsequent scripts.
|
||||
|
||||
set -e
|
||||
|
|
Loading…
Reference in New Issue