#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "mips32.h"#include <stdlib.h>#include <readline/readline.h>#include <readline/history.h>#include "cmdparser.c"#include "lib/echo.c"#include "lib/mem.c"#include "lib/reg.c"#include "lib/jtagtest.c"#include "lib/put.c"#include "lib/sput.c"#include "lib/fput.c"#include "lib/get.c"#include "lib/fget.c"#include "lib/sget.c"#include "lib/env.c"#include "lib/run.c"#include "lib/source.c"#include "lib/flash.c"#include "lib/linux.c"#include "lib/import.c"#include "lib/putelf.c"#include "lib/cache.c"#include "lib/checksum.c"#include "lib/memtest.c"#include "Targets/main.c"#include "readline.c"
Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
| mycmd_init (q, quit,"q","quit this shell") | |
| static int | quit (int argc, char **argv) |
Variables | |
| static int | ejtag_quit = 0 |
| int | enable_timer |
| unsigned long | help_addr = 0xa0020000 |
| int | log_disasm = 0 |
| static int | syscall_addrwidth = 1 |
| unsigned int | timer_val |
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 61 of file main.c.
References _do_cmd(), do_cmd(), ejtag_quit, enable_timer, fd, initialize_readline(), log_disasm, timer_val, ui_fifomem, and ui_fifomem_size.
00062 { 00063 static char str[1024]; 00064 int count; 00065 int opt; 00066 int no_use_readline = 0; 00067 int disable_cfg = 0; 00068 00069 setbuffer(stdout,0,0); 00070 ui_fifomem=malloc(ui_fifomem_size); 00071 00072 do_cmd("verbose off"); 00073 00074 while ((opt=getopt(argc,argv,"ldSctT:e:")) != -1 ) 00075 { 00076 switch (opt) { 00077 case 'd': 00078 do_cmd("verbose on"); 00079 break; 00080 case 'e': 00081 do_cmd(optarg); 00082 break; 00083 case 'l': 00084 no_use_readline = 1; 00085 break; 00086 case 'S': 00087 log_disasm = 1; 00088 break; 00089 case 't': 00090 enable_timer = -1; 00091 break; 00092 case 'T': 00093 timer_val = strtoul(optarg,0,0); 00094 break; 00095 case 'c': 00096 disable_cfg = 1; 00097 break; 00098 } 00099 } 00100 00101 if(!disable_cfg) 00102 { 00103 int fd; 00104 fd = open("ejtag.cfg",O_RDONLY); 00105 if(fd>=0) 00106 { 00107 close(fd); 00108 do_cmd("source ejtag.cfg"); 00109 } 00110 } 00111 00112 00113 if(no_use_readline) 00114 { 00115 while(!ejtag_quit) 00116 { 00117 char *pstart=str,*pend; 00118 int len=1023; 00119 printf("\n-"); 00120 while(1) 00121 { 00122 if(enable_timer != -1) enable_timer = 1; 00123 count=read(0,pstart,len); 00124 if(enable_timer != -1) enable_timer = 0; 00125 if(count<=0)return; 00126 pstart[count]=0; 00127 pend=_do_cmd(str,1); 00128 if((pend-pstart)==count)break; 00129 strcpy(str,pend); 00130 pstart=str+strlen(str); 00131 len=1023-strlen(str); 00132 } 00133 } 00134 } 00135 else 00136 { 00137 initialize_readline(); 00138 00139 read_history("ejtag.rc"); 00140 while(!ejtag_quit) 00141 { 00142 char *line; 00143 if(enable_timer != -1) enable_timer = 1; 00144 line= readline("-"); 00145 if(enable_timer != -1) enable_timer = 0; 00146 if(!line)break; 00147 add_history(line); 00148 _do_cmd(line,0); 00149 free(line); 00150 } 00151 write_history("ejtag.rc"); 00152 } 00153 return 0; 00154 }
| mycmd_init | ( | q | , | |
| quit | , | |||
| "q" | , | |||
| "quit this shell" | ||||
| ) |
| static int quit | ( | int | argc, | |
| char ** | argv | |||
| ) | [static] |
Definition at line 46 of file main.c.
References ejtag_quit.
Referenced by fGDBRDP_Handler().
00047 { 00048 ejtag_quit = 1; 00049 return 0; 00050 }
int ejtag_quit = 0 [static] |
| int enable_timer |
| unsigned long help_addr = 0xa0020000 |
Definition at line 16 of file main.c.
Referenced by cmd_checksum(), cmd_fget(), cmd_fput(), cmd_fputflash(), cmd_get(), cmd_program(), cmd_put(), and cmd_set().
| int log_disasm = 0 |
int syscall_addrwidth = 1 [static] |
Definition at line 15 of file main.c.
Referenced by cmd_mems(), cmd_spiroms(), dump(), jtagregs(), modify(), and mycp0s().
| unsigned int timer_val |
1.5.6