add PikaDebug

This commit is contained in:
lyon 2022-01-28 00:43:09 +08:00
parent 92dd8379d2
commit e4363d03a2
7 changed files with 54 additions and 10 deletions

View File

@ -0,0 +1,5 @@
from PikaObj import *
class Debuger(TinyObj):
def set_trace():
pass

View File

@ -0,0 +1,17 @@
#include "PikaDebug_Debuger.h"
static enum shell_state __obj_shellLineHandler_obj_run(PikaObj *self, char *input_line){
/* exit */
if (strEqu("exit()", input_line)) {
/* exit pika shell */
return SHELL_STATE_EXIT;
}
/* run single line */
obj_run(self, input_line);
return SHELL_STATE_CONTINUE;
}
extern PikaObj* __pikaMain;
void PikaDebug_Debuger_set_trace(PikaObj* self) {
obj_shellLineProcess(__pikaMain, __obj_shellLineHandler_obj_run);
}

View File

@ -26,7 +26,8 @@
"pikaconfigvalid.h": "c",
"*.cfg": "c",
"pikastdtask_task.h": "c",
"gtesttask_task.h": "c"
"gtesttask_task.h": "c",
"pikadebug_debuger.h": "c"
},
"python.formatting.provider": "autopep8"
}

View File

@ -0,0 +1,5 @@
from PikaObj import *
class Debuger(TinyObj):
def set_trace():
pass

View File

@ -3,16 +3,14 @@ import PikaStdDevice
import PikaStdData
import GTestTask
import PikaMath
import PikaDebug
from PikaObj import *
pkdb = PikaDebug.Debuger()
def fun(a,b,c,d,e):
print(a)
print(b)
print(c)
print(d)
print(e)
# i = 0
# while i < 10:
# i = i + 1
# print('i :' + str(i))
# pkdb.set_trace()
fun(10,20,30,40, 'xxx')
# while True:
# pass

View File

@ -0,0 +1,17 @@
#include "PikaDebug_Debuger.h"
static enum shell_state __obj_shellLineHandler_obj_run(PikaObj *self, char *input_line){
/* exit */
if (strEqu("exit()", input_line)) {
/* exit pika shell */
return SHELL_STATE_EXIT;
}
/* run single line */
obj_run(self, input_line);
return SHELL_STATE_CONTINUE;
}
extern PikaObj* __pikaMain;
void PikaDebug_Debuger_set_trace(PikaObj* self) {
obj_shellLineProcess(__pikaMain, __obj_shellLineHandler_obj_run);
}

View File

@ -2,4 +2,5 @@ pkg=$1
cp package/pikascript/pikascript-lib/$pkg ../../package/ -r
cp package/pikascript/$pkg.py ../../package/$pkg/
git add package/pikascript/pikascript-lib/$pkg
git add package/pikascript/$pkg.py
git add ../../package/$pkg