#include <curses.h>
#include <string.h>
#include <pthread.h>
#include "vm.h"
#include "fastmath.h"
#include "_impl.h"
#include "vm_engine.h"
#include "object.h"
#include "program.h"
Data Structures | |
struct | _std_io_to_buf |
struct | _window_t |
struct | command_t |
struct | _thread_engine_t |
Defines | |
#define | ST_W ((getmaxx(stdscr)-1)/5) |
#define | ST_H ((getmaxy(stdscr)-1)/3) |
#define | STATE_IDLE 0 |
#define | STATE_RUNNING 1 |
#define | STATE_STEPPING 2 |
#define | STATE_DEAD 3 |
#define | TINYAML_ABOUT |
#define | cmp_param(_n, _arg_str_long, _arg_str_short) |
Typedefs | |
typedef struct _window_t * | window_t |
Enumerations | |
enum | { CodeWin = 0, DataSeg, DataStack, LocalsStack, ClosureStack, CallStack, CatchStack, StdOutWin, StdErrWin, N_WINDOWS } |
Functions | |
void | dbg_out (const char *str) |
void | dbg_err (const char *str) |
void | init_outerr () |
void | term_outerr () |
void | lookup_label_and_ofs (program_t cs, word_t ip, const char **label, word_t *ofs) |
static void | dbg_data_stack_renderer (WINDOW *w, vm_data_t d) |
static void | dbg_closure_stack_renderer (WINDOW *w, dynarray_t *da) |
static void | dbg_call_stack_renderer (WINDOW *w, struct _call_stack_entry_t *cse) |
static void | dbg_catch_stack_renderer (WINDOW *w, struct _call_stack_entry_t *cse) |
static void | dbg_render_stack (WINDOW *w, generic_stack_t s, word_t skip, word_t count, const char *prefix, void(*renderer)(WINDOW *, void *), int disp_start, int disp_incr) |
void | create_window (window_t ww, void(*r)(WINDOW *, int, vm_t, thread_t), int x, int y, int W, int H) |
void | destroy_window (window_t ww) |
void | print_centered (WINDOW *w, int is_cur, int y, const char *str) |
void | render_win (window_t w, const char *title, vm_t vm, thread_t t) |
void | do_scroll_down () |
void | do_scroll_up () |
void | do_step () |
void | do_run () |
void | do_cycle_win () |
void | term () |
void | do_quit () |
void | do_help () |
void | read_command (vm_t vm, thread_t t) |
word_t | calc_count (int n, word_t sz) |
static void | repaint (vm_t vm, thread_t t, int do_command) |
void | render_code (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_callstack (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_catchstack (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_datastack (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_localsstack (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_closurestack (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_dataseg (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_stdout (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | render_stderr (WINDOW *w, int vofs, vm_t vm, thread_t t) |
void | init () |
int | do_args (vm_t vm, int argc, const char *argv[]) |
int | main (int argc, const char **argv) |
void _VM_CALL | dbg_run (vm_engine_t e, program_t p, word_t ip, word_t prio) |
void _VM_CALL | thread_failed (vm_t vm, thread_t t) |
void _VM_CALL | dbg_thread_failed (vm_t vm, thread_t t) |
void _VM_CALL | e_stub (vm_engine_t) |
void _VM_CALL | dbg_debug (vm_engine_t e) |
void _VM_CALL | dbg_cli_lock (struct _thread_engine_t *e) |
void _VM_CALL | dbg_cli_unlock (struct _thread_engine_t *e) |
void _VM_CALL | dbg_vm_lock (struct _thread_engine_t *e) |
void _VM_CALL | dbg_vm_unlock (struct _thread_engine_t *e) |
void _VM_CALL | dbg_init (struct _thread_engine_t *e) |
Variables | |
struct _std_io_to_buf StdOut | StdErr |
struct _window_t | windows [N_WINDOWS] |
int | cur_win = 0 |
int | state = STATE_IDLE |
command_t | commands_all [] |
command_t | commands [N_WINDOWS][32] |
vm_t | vm |
const vm_engine_t | debug_engine |
const vm_engine_t | debug_engine |