mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
support 'p' commond for pika-debuger
This commit is contained in:
parent
89072c3f22
commit
50b097e786
@ -3,3 +3,4 @@ from PikaObj import *
|
||||
class Debuger(TinyObj):
|
||||
def set_trace():
|
||||
pass
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "PikaDebug_Debuger.h"
|
||||
#include "PikaVM.h"
|
||||
#include "dataStrs.h"
|
||||
|
||||
extern PikaObj* __pikaMain;
|
||||
static enum shell_state __obj_shellLineHandler_debuger(PikaObj* self,
|
||||
@ -8,11 +10,22 @@ static enum shell_state __obj_shellLineHandler_debuger(PikaObj* self,
|
||||
/* exit pika shell */
|
||||
return SHELL_STATE_EXIT;
|
||||
}
|
||||
/* launch shell */
|
||||
if (strEqu("sh", input_line)) {
|
||||
/* exit pika shell */
|
||||
pikaScriptShell(__pikaMain);
|
||||
return SHELL_STATE_CONTINUE;
|
||||
}
|
||||
/* print */
|
||||
if (strIsStartWith(input_line, "p ")) {
|
||||
char* path = input_line + 2;
|
||||
Arg* asm_buff = arg_setStr(NULL, "", "B0\n1 REF ");
|
||||
asm_buff = arg_strAppend(asm_buff, path);
|
||||
asm_buff = arg_strAppend(asm_buff, "\n0 RUN print\n");
|
||||
pikaVM_runAsm(__pikaMain, arg_getStr(asm_buff));
|
||||
arg_deinit(asm_buff);
|
||||
}
|
||||
return SHELL_STATE_CONTINUE;
|
||||
}
|
||||
|
||||
void PikaDebug_Debuger_set_trace(PikaObj* self) {
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "PikaDebug_Debuger.h"
|
||||
#include "PikaVM.h"
|
||||
#include "dataStrs.h"
|
||||
|
||||
extern PikaObj* __pikaMain;
|
||||
static enum shell_state __obj_shellLineHandler_debuger(PikaObj* self,
|
||||
@ -8,11 +10,21 @@ static enum shell_state __obj_shellLineHandler_debuger(PikaObj* self,
|
||||
/* exit pika shell */
|
||||
return SHELL_STATE_EXIT;
|
||||
}
|
||||
/* launch shell */
|
||||
if (strEqu("sh", input_line)) {
|
||||
/* exit pika shell */
|
||||
pikaScriptShell(__pikaMain);
|
||||
return SHELL_STATE_CONTINUE;
|
||||
}
|
||||
/* print */
|
||||
if (strIsStartWith(input_line, "p ")) {
|
||||
char* path = input_line + 2;
|
||||
Arg* asm_buff = arg_setStr(NULL, "", "B0\n1 REF ");
|
||||
asm_buff = arg_strAppend(asm_buff, path);
|
||||
asm_buff = arg_strAppend(asm_buff, "\n0 RUN print\n");
|
||||
pikaVM_runAsm(__pikaMain, arg_getStr(asm_buff));
|
||||
arg_deinit(asm_buff);
|
||||
}
|
||||
return SHELL_STATE_CONTINUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user