Browse Source

Bugfix env update in shell & delete the bytecode print when exec

Yann Weber 1 year ago
parent
commit
8cc1cdf286
2 changed files with 13 additions and 11 deletions
  1. 11
    10
      shell.c
  2. 2
    1
      shell.h

+ 11
- 10
shell.c View File

@@ -85,6 +85,7 @@ int asmsh_exec(asmsh_t *sh, const char *cmd)
85 85
 			ret = _compile_step(sh, cmd);
86 86
 			break;
87 87
 	}
88
+	asmsh_env_update_regs(sh->env);
88 89
 	return ret;
89 90
 }
90 91
 
@@ -106,16 +107,16 @@ static int _compile_step(asmsh_t *sh, const char *cmd)
106 107
 	if(sh->last_instr) { free(sh->last_instr); }
107 108
 	sh->last_instr = strdup(cmd);
108 109
 
109
-char buf[256];
110
-int _ret;
111
-_ret = snprintf(buf, 255, "'%s' = 0x", cmd);
112
-for(int _i=0; _i<bcode.size; _i++)
113
-{
114
-	_ret += snprintf(buf+_ret, 255-_ret, "%02x", bcode.bytes[_i]);
115
-}
116
-_ret += snprintf(buf+_ret, 255-_ret, "(%d)", bcode.size);
117
-buf[_ret] = '\0';
118
-asmsh_log_info(buf);
110
+//char buf[256];
111
+//int _ret;
112
+//_ret = snprintf(buf, 255, "'%s' = 0x", cmd);
113
+//for(int _i=0; _i<bcode.size; _i++)
114
+//{
115
+//	_ret += snprintf(buf+_ret, 255-_ret, "%02x", bcode.bytes[_i]);
116
+//}
117
+//_ret += snprintf(buf+_ret, 255-_ret, "(%d)", bcode.size);
118
+//buf[_ret] = '\0';
119
+//asmsh_log_info(buf);
119 120
 
120 121
 	if(asmsh_env_write_code(sh->env, &bcode))
121 122
 	{

+ 2
- 1
shell.h View File

@@ -44,6 +44,7 @@ void asmsh_cleanup(asmsh_t *sh);
44 44
 /** @return <0 on error 0 on ok 1 on exit */
45 45
 int asmsh_exec(asmsh_t *sh, const char *cmd);
46 46
 
47
-#include "shell_cmds.h"
47
+
48
+#include "shell_cmds.h" // declares the static commands list
48 49
 
49 50
 #endif

Loading…
Cancel
Save