refactor: make asm cleanup/fixup work in memory

This commit is contained in:
Dobin
2024-04-28 19:43:08 +01:00
parent c82c99e0eb
commit 1b245e5506
4 changed files with 132 additions and 166 deletions
+9 -10
View File
@@ -109,12 +109,15 @@ def start(settings: Settings) -> int:
prepare_project("default", settings)
# Do the thing and catch the errors
try:
if False:
start_real(settings)
except Exception as e:
logger.error(f'Error compiling: {e}')
observer.write_logs(settings.main_dir)
return 1
else:
try:
start_real(settings)
except Exception as e:
logger.error(f'Error compiling: {e}')
observer.write_logs(settings.main_dir)
return 1
# Cleanup files
clean_tmp_files()
@@ -146,11 +149,7 @@ def start_real(settings: Settings):
phases.compiler.compile(
c_in = settings.main_c_path,
asm_out = settings.main_asm_path,
payload_len = project.payload.len,
carrier = project.carrier,
source_style = project.settings.source_style,
exe_host = project.exe_host,
short_call_patching = project.settings.short_call_patching)
carrier = project.carrier)
# Assemble: Assemble .asm to .shc (ASM -> SHC)
if settings.generate_shc_from_asm: