lightovernight d0980c6934
Gsoc 2025 debugger (#385)
* add debugger module

* simplify the workdir process

* Update main.c

* Update main.c

* update debugger

* change port to 6110

* Update main.c

* simplify the workdir process and minor optimizations

* implement exit event

* Fix memory management in setBreakpoints

---------

Co-authored-by: blueloveTH <blueloveth@foxmail.com>
2025-08-09 14:43:16 +08:00

27 lines
958 B
C

#pragma once
#include "pocketpy/common/sstream.h"
#include "pocketpy/common/str.h"
#include "pocketpy/common/vector.h"
#include "pocketpy/pocketpy.h"
typedef enum { C11_STEP_IN, C11_STEP_OVER, C11_STEP_OUT, C11_STEP_CONTINUE } C11_STEP_MODE;
typedef enum {
C11_DEBUGGER_SUCCESS = 0,
C11_DEBUGGER_EXIT = 1,
C11_DEBUGGER_UNKNOW_ERROR = 3,
C11_DEBUGGER_FILEPATH_ERROR = 7
} C11_DEBUGGER_STATUS;
void c11_debugger_init(void);
void c11_debugger_set_step_mode(C11_STEP_MODE mode);
C11_DEBUGGER_STATUS c11_debugger_on_trace(py_Frame* frame, enum py_TraceEvent event);
void c11_debugger_frames(c11_sbuf* buffer);
void c11_debugger_scopes(int frameid, c11_sbuf* buffer);
bool c11_debugger_unfold_var(int var_id, c11_sbuf* buffer);
int c11_debugger_setbreakpoint(const char* filename, int lineno);
int c11_debugger_reset_breakpoints_by_source(const char* sourcesname);
int c11_debugger_should_pause(void);
int c11_debugger_should_keep_pause(void);