📄 dbug.h
字号:
char * cmd; /* command name user types, ie. GO */
int unique; /* num chars to uniquely match */
int min_args; /* min num of args command accepts */
int max_args; /* max num of args command accepts */
int flags; /* command flags (repeat, hidden) */
void (*func)(int, char **); /* actual function to call */
char * description; /* brief description of command */
char * syntax; /* syntax of command */
} UIF_CMD;
/*
* Prototype and macro for size of the command table
*/
extern UIF_CMD UIF_CMDTAB[];
extern const int UIF_NUM_CMD;
#define UIF_CMDTAB_SIZE (sizeof(UIF_CMDTAB)/sizeof(UIF_CMD))
#define UIF_CMD_FLAG_REPEAT (0x0001)
#define UIF_CMD_FLAG_HIDDEN (0x0002)
/*
* Function prototypes for core dBUG commands
*/
void
uif_cmd_asm (int, char **);
void
uif_cmd_bc (int, char **);
void
uif_cmd_bf (int, char **);
void
uif_cmd_bm (int, char **);
void
uif_cmd_br (int, char **);
void
uif_cmd_bs (int, char **);
void
uif_cmd_dc (int, char **);
void
uif_cmd_dis (int, char **);
void
uif_cmd_dl (int, char **);
void
uif_cmd_dn (int, char **);
void
uif_cmd_fl (int, char **);
void
uif_cmd_go (int, char **);
void
uif_cmd_gt (int, char **);
void
uif_cmd_help (int, char **);
void
uif_cmd_lr (int, char **);
void
uif_cmd_lw (int, char **);
void
uif_cmd_md (int, char **);
void
uif_cmd_mm (int, char **);
void
uif_cmd_rd (int, char **);
void
uif_cmd_rm (int, char **);
void
uif_cmd_reset (int, char **);
void
uif_cmd_sd (int, char **);
void
uif_cmd_set (int, char **);
void
uif_cmd_show (int, char **);
void
uif_cmd_step (int, char **);
void
uif_cmd_sym (int, char **);
void
uif_cmd_trace (int, char **);
void
uif_cmd_up (int, char **);
void
uif_cmd_ver (int, char **);
/*
* Macros for User InterFace command table entries
*/
#ifndef UIF_CMD_ASM
#define UIF_CMD_ASM \
{"asm",2,0,UIF_MAX_ARGS,0,uif_cmd_asm,"Assembly","<<addr> <assembly>>"},
#endif
#ifndef UIF_CMD_BC
#define UIF_CMD_BC \
{"bc",2,3,3,0,uif_cmd_bc,"Block Compare","addr1 addr2 length"},
#endif
#ifndef UIF_CMD_BF
#define UIF_CMD_BF \
{"bf",2,3,4,0,uif_cmd_bf,"Block Fill","begin end data <inc>"},
#endif
#ifndef UIF_CMD_BM
#define UIF_CMD_BM \
{"bm",2,3,3,0,uif_cmd_bm,"Block Move","begin end dest"},
#endif
#ifndef UIF_CMD_BR
#define UIF_CMD_BR \
{"br",2,0,UIF_MAX_ARGS,0,uif_cmd_br,"Breakpoint",\
"<addr> <-c|t <value>> <-r <addr ...>> <-i>"},
#endif
#ifndef UIF_CMD_BS
#define UIF_CMD_BS \
{"bs",2,3,3,0,uif_cmd_bs,"Block Search","begin end data"},
#endif
#ifndef UIF_CMD_DC
#define UIF_CMD_DC \
{"dc",2,1,1,0,uif_cmd_dc,"Data Convert","data"},
#endif
#ifndef UIF_CMD_DIS
#define UIF_CMD_DIS \
{"dis",2,0,1,1,uif_cmd_dis,"Disassemble","<addr>"},
#endif
#ifndef UIF_CMD_DL
#define UIF_CMD_DL \
{"dl",2,0,1,0,uif_cmd_dl,"Download Console","<offset>"},
#endif
#ifndef UIF_CMD_DN
#define UIF_CMD_DN \
{"dn",2,0,4,0,uif_cmd_dn,"Download Network",\
"<-c|e|i|s <-o offset>> <filename>"},
#endif
#ifndef UIF_CMD_FL
#define UIF_CMD_FL \
{"fl",2,0,4,0,uif_cmd_fl,"Flash Utilities","<operation ...>"},
#endif
#ifndef UIF_CMD_GO
#define UIF_CMD_GO \
{"go",1,0,1,1,uif_cmd_go,"Execute","<addr>"},
#endif
#ifndef UIF_CMD_GT
#define UIF_CMD_GT \
{"gt",1,1,1,0,uif_cmd_gt,"Execute To","addr"},
#endif
#ifndef UIF_CMD_HELP
#define UIF_CMD_HELP \
{"help",2,0,1,0,uif_cmd_help,"Help","<cmd>"},
#endif
#ifndef UIF_CMD_LR
#define UIF_CMD_LR \
{"lr",2,1,1,0,uif_cmd_lr,"Loop Read","addr"},
#endif
#ifndef UIF_CMD_LW
#define UIF_CMD_LW \
{"lw",2,2,2,0,uif_cmd_lw,"Loop Write","addr data"},
#endif
#ifndef UIF_CMD_MD
#define UIF_CMD_MD \
{"md",2,0,2,1,uif_cmd_md,"Memory Display","begin <end>"},
#endif
#ifndef UIF_CMD_MM
#define UIF_CMD_MM \
{"mm",2,1,2,0,uif_cmd_mm,"Memory Modify","addr <data>"},
#endif
#ifndef UIF_CMD_RD
#define UIF_CMD_RD \
{"rd",2,0,UIF_MAX_ARGS,0,uif_cmd_rd,"Register Display","<register ...>"},
#endif
#ifndef UIF_CMD_RM
#define UIF_CMD_RM \
{"rm",2,2,2,0,uif_cmd_rm,"Register Modify","reg data"},
#endif
#ifndef UIF_CMD_RESET
#define UIF_CMD_RESET \
{"reset",5,0,0,0,uif_cmd_reset,"Reset",""},
#endif
#ifndef UIF_CMD_SD
#define UIF_CMD_SD \
{"sd",2,0,0,0,uif_cmd_sd,"Stack Dump",""},
#endif
#ifndef UIF_CMD_SET
#define UIF_CMD_SET \
{"set",3,0,2,0,uif_cmd_set,"Set Config","<option value>"},
#endif
#ifndef UIF_CMD_SHOW
#define UIF_CMD_SHOW \
{"show",3,0,1,0,uif_cmd_show,"Show Config","<option>"},
#endif
#ifndef UIF_CMD_STEP
#define UIF_CMD_STEP \
{"step",2,0,0,1,uif_cmd_step,"Step (Over)",""},
#endif
#ifndef UIF_CMD_SYM
#define UIF_CMD_SYM \
{"sym",3,1,UIF_MAX_ARGS,0,uif_cmd_sym,"Symbol",\
"<symb> <-a symb value> <-r sym> <-c|l|s>"},
#endif
#ifndef UIF_CMD_TRACE
#define UIF_CMD_TRACE \
{"trace",1,0,1,1,uif_cmd_trace,"Trace (Into)","<count>"},
#endif
#ifndef UIF_CMD_UP
#define UIF_CMD_UP \
{"up",2,3,3,0,uif_cmd_up,"Upload Binary Data","begin end filename"},
#endif
#ifndef UIF_CMD_VER
#define UIF_CMD_VER \
{"ver",3,0,0,0,uif_cmd_ver,"Display Version",""},
#endif
#ifndef DBUG_NETWORK
#undef UIF_CMD_DN
#define UIF_CMD_DN
#undef UIF_CMD_UP
#define UIF_CMD_UP
#endif
/*
* Macro to include ALL core dBUG commands
*/
#define UIF_CMDS_ALL \
UIF_CMD_ASM \
UIF_CMD_BC \
UIF_CMD_BF \
UIF_CMD_BM \
UIF_CMD_BR \
UIF_CMD_BS \
UIF_CMD_DC \
UIF_CMD_DIS \
UIF_CMD_DL \
UIF_CMD_DN \
UIF_CMD_FL \
UIF_CMD_GO \
UIF_CMD_GT \
UIF_CMD_HELP \
UIF_CMD_LR \
UIF_CMD_LW \
UIF_CMD_MD \
UIF_CMD_MM \
UIF_CMD_RD \
UIF_CMD_RM \
UIF_CMD_RESET \
UIF_CMD_SD \
UIF_CMD_SET \
UIF_CMD_SHOW \
UIF_CMD_STEP \
UIF_CMD_SYM \
UIF_CMD_TRACE \
UIF_CMD_UP \
UIF_CMD_VER
/********************************************************************/
/* */
/* Generic User InterFace Set/Show Commands */
/* */
/********************************************************************/
typedef const struct
{
char * option;
int unique;
int min_args;
int max_args;
int flags;
void (*func)(int, char **);
char * syntax;
} UIF_SETCMD;
/*
* Prototype and macro for size of the table
*/
extern UIF_SETCMD UIF_SETCMDTAB[];
extern const int UIF_NUM_SETCMD;
#define UIF_SETCMDTAB_SIZE (sizeof(UIF_SETCMDTAB)/sizeof(UIF_SETCMD))
#define UIF_SETCMD_FLAG_HIDDEN (0x0001)
/********************************************************************/
/*
* Function prototypes for dBUG SET/SHOW commands
*/
void
uif_setcmd_base (int, char **);
void
uif_setcmd_baud (int, char **);
void
uif_setcmd_server (int, char **);
void
uif_setcmd_client (int, char **);
void
uif_setcmd_gateway (int, char **);
void
uif_setcmd_netmask (int, char **);
void
uif_setcmd_filename (int, char **);
void
uif_setcmd_filetype (int, char **);
/********************************************************************/
/*
* Macros for SET/SHOW command table entries
*/
#ifndef UIF_SETCMD_BASE
#define UIF_SETCMD_BASE \
{"base",4,0,1,0, uif_setcmd_base, "<hex|dec|bin|oct|unknown>"},
#endif
#ifndef UIF_SETCMD_BAUD
#define UIF_SETCMD_BAUD \
{"baud",4,0,1,0, uif_setcmd_baud, "<9600|19200|38400>"},
#endif
#ifndef UIF_SETCMD_SERVER
#define UIF_SETCMD_SERVER \
{"server",4,0,1,0, uif_setcmd_server, "<host IP>"},
#endif
#ifndef UIF_SETCMD_CLIENT
#define UIF_SETCMD_CLIENT \
{"client",4,0,1,0, uif_setcmd_client, "<board IP>"},
#endif
#ifndef UIF_SETCMD_GATEWAY
#define UIF_SETCMD_GATEWAY \
{"gateway",4,0,1,0, uif_setcmd_gateway, "<gateway IP>"},
#endif
#ifndef UIF_SETCMD_NETMASK
#define UIF_SETCMD_NETMASK \
{"netmask",4,0,1,0, uif_setcmd_netmask, "<netmask>"},
#endif
#ifndef UIF_SETCMD_FILENAME
#define UIF_SETCMD_FILENAME \
{"filename",5,0,1,0, uif_setcmd_filename, "<filename>"},
#endif
#ifndef UIF_SETCMD_FILETYPE
#define UIF_SETCMD_FILETYPE \
{"filetype",5,0,1,0, uif_setcmd_filetype, "<srec|coff|elf|image>"},
#endif
#ifndef DBUG_NETWORK
#undef UIF_SETCMD_SERVER
#undef UIF_SETCMD_CLIENT
#undef UIF_SETCMD_GATEWAY
#undef UIF_SETCMD_NETMASK
#undef UIF_SETCMD_FILENAME
#undef UIF_SETCMD_FILETYPE
#define UIF_SETCMD_SERVER
#define UIF_SETCMD_CLIENT
#define UIF_SETCMD_GATEWAY
#define UIF_SETCMD_NETMASK
#define UIF_SETCMD_FILENAME
#define UIF_SETCMD_FILETYPE
#endif
/********************************************************************/
/*
* Macro to include dBUG SET/SHOW commands
*/
#define UIF_SETCMDS_ALL \
UIF_SETCMD_BASE \
UIF_SETCMD_BAUD \
UIF_SETCMD_SERVER \
UIF_SETCMD_CLIENT \
UIF_SETCMD_GATEWAY \
UIF_SETCMD_NETMASK \
UIF_SETCMD_FILENAME \
UIF_SETCMD_FILETYPE
/********************************************************************/
#endif /* _DBUG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -