FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/lldbg/dispatch.c @ 865:f5affe83ba2d
lldbg hack (poor girl's substitute for JTAG) implemented
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Fri, 15 May 2015 00:02:03 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
864:4fa939eada22 | 865:f5affe83ba2d |
---|---|
1 /* | |
2 * This module implements the dispatch of interactively entered | |
3 * commands to their respective implementation functions via cmdtab. | |
4 */ | |
5 | |
6 #include "cmdtab.h" | |
7 | |
8 extern char lldbg_command[]; | |
9 extern struct cmdtab lldbg_cmdtab[]; | |
10 | |
11 void | |
12 lldbg_command_dispatch() | |
13 { | |
14 char *cp, *np; | |
15 struct cmdtab *tp; | |
16 | |
17 for (cp = lldbg_command; *cp == ' '; cp++) | |
18 ; | |
19 if (!*cp) | |
20 return; | |
21 for (np = cp; *cp && *cp != ' '; cp++) | |
22 ; | |
23 if (*cp) | |
24 *cp++ = '\0'; | |
25 for (tp = lldbg_cmdtab; tp->cmd; tp++) | |
26 if (!strcmp(tp->cmd, np)) | |
27 break; | |
28 if (tp->func) | |
29 tp->func(cp); | |
30 else | |
31 lldbg_printf("ERROR: unknown or unimplemented command\n"); | |
32 } |