comparison debug.h @ 2188:e17d99c96c89

Make blocks an explicitly supported concept in the debugger rather than a one-off for the commands command
author Michael Pavone <pavone@retrodev.com>
date Sat, 20 Aug 2022 11:40:41 -0700
parents 2d7f8195be3b
children d00fb9c6a6a2
comparison
equal deleted inserted replaced
2187:d0129f19ca52 2188:e17d99c96c89
54 expr *parsed; 54 expr *parsed;
55 uint32_t value; 55 uint32_t value;
56 } command_arg; 56 } command_arg;
57 57
58 typedef struct debug_root debug_root; 58 typedef struct debug_root debug_root;
59 typedef uint8_t (*raw_cmd)(debug_root *root, char *format, char *param); 59 typedef struct parsed_command parsed_command;
60 typedef uint8_t (*cmd)(debug_root *root, char *format, int num_args, command_arg *args); 60 typedef uint8_t (*cmd_fun)(debug_root *root, parsed_command *cmd);
61 61
62 typedef struct { 62 typedef struct {
63 const char **names; 63 const char **names;
64 const char *usage; 64 const char *usage;
65 const char *desc; 65 const char *desc;
66 raw_cmd raw_impl; 66 cmd_fun impl;
67 cmd impl;
68 int min_args; 67 int min_args;
69 int max_args; 68 int max_args;
70 uint8_t skip_eval; 69 uint8_t skip_eval;
71 uint8_t visited; 70 uint8_t visited;
71 uint8_t has_block;
72 uint8_t accepts_else;
73 uint8_t raw_args;
72 } command_def; 74 } command_def;
73 75
74 typedef struct disp_def { 76 typedef struct disp_def {
75 struct disp_def *next; 77 struct disp_def *next;
76 char *format; 78 char *format;
78 command_arg *args; 80 command_arg *args;
79 uint32_t index; 81 uint32_t index;
80 } disp_def; 82 } disp_def;
81 83
82 typedef struct { 84 typedef struct {
83 command_def *def; 85 parsed_command *commands;
84 char *format; 86 int num_commands;
85 char *raw; 87 } command_block;
86 command_arg *args; 88
87 int num_args; 89 struct parsed_command {
88 } parsed_command; 90 command_def *def;
91 char *format;
92 char *raw;
93 command_arg *args;
94 int num_args;
95 command_block block;
96 command_block else_block;
97 };
89 98
90 typedef struct bp_def { 99 typedef struct bp_def {
91 struct bp_def *next; 100 struct bp_def *next;
92 parsed_command *commands; 101 parsed_command *commands;
93 expr *condition; 102 expr *condition;