2022-01-28 00:43:09 +08:00
|
|
|
#include "PikaDebug_Debuger.h"
|
|
|
|
|
2022-01-28 12:07:48 +08:00
|
|
|
extern PikaObj* __pikaMain;
|
2022-01-28 12:10:32 +08:00
|
|
|
static enum shell_state __obj_shellLineHandler_debuger(PikaObj* self,
|
2022-01-28 12:07:48 +08:00
|
|
|
char* input_line) {
|
|
|
|
/* continue */
|
|
|
|
if (strEqu("c", input_line)) {
|
2022-01-28 00:43:09 +08:00
|
|
|
/* exit pika shell */
|
|
|
|
return SHELL_STATE_EXIT;
|
|
|
|
}
|
2022-01-28 12:07:48 +08:00
|
|
|
if (strEqu("sh", input_line)) {
|
|
|
|
/* exit pika shell */
|
|
|
|
pikaScriptShell(__pikaMain);
|
|
|
|
return SHELL_STATE_CONTINUE;
|
|
|
|
}
|
2022-01-28 00:43:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void PikaDebug_Debuger_set_trace(PikaObj* self) {
|
2022-01-28 12:07:48 +08:00
|
|
|
struct shell_config cfg = {
|
|
|
|
.prefix = "(pika-debug) ",
|
|
|
|
};
|
2022-01-28 12:10:32 +08:00
|
|
|
obj_shellLineProcess(__pikaMain, __obj_shellLineHandler_debuger, &cfg);
|
2022-01-28 00:43:09 +08:00
|
|
|
}
|