comparison lldbg/dispatch.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
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 }