Rearrange what is printed in vm_print_all

First the program, then the registers then the stack.
This commit is contained in:
2023-10-23 00:48:53 +01:00
parent d0ee1f3b1f
commit 00f3b3bf21
2 changed files with 4 additions and 5 deletions

View File

@@ -35,7 +35,6 @@ int interpret_bytecode(const char *filepath)
{
const char *error_str = err_as_cstr(err);
fprintf(stderr, "[ERROR]: %s\n", error_str);
fprintf(stderr, "\t VM State:\n");
vm_print_all(&vm, stderr);
ret = 255 - err;
}

View File

@@ -350,6 +350,10 @@ void vm_print_program(vm_t *vm, FILE *fp)
void vm_print_all(vm_t *vm, FILE *fp)
{
fputs("----------------------------------------------------------------------"
"----------\n",
fp);
vm_print_program(vm, fp);
fputs("----------------------------------------------------------------------"
"----------\n",
fp);
@@ -361,10 +365,6 @@ void vm_print_all(vm_t *vm, FILE *fp)
fputs("----------------------------------------------------------------------"
"----------\n",
fp);
vm_print_program(vm, fp);
fputs("----------------------------------------------------------------------"
"----------\n",
fp);
}
err_t vm_push_byte(vm_t *vm, data_t b)