| 288 | } |
| 289 | |
| 290 | static bool process_command(char* command) |
| 291 | { |
| 292 | trim(command); |
| 293 | |
| 294 | char *rest = strchr(command, ' '); |
| 295 | if (rest) { |
| 296 | *rest++ = '\0'; |
| 297 | trim(rest); |
| 298 | } |
| 299 | |
| 300 | if (!rest) { |
| 301 | WARNING("The %s command requires at least one argument", command); |
| 302 | } else if (!strcmp(command, "set")) { |
| 303 | process_set(rest); |
| 304 | } else if (!strcmp(command, "trace")) { |
| 305 | process_trace(rest); |
| 306 | } else if (!strcmp(command, "dump")) { |
| 307 | process_dump(rest); |
| 308 | } else if (!strcmp(command, "reset")) { |
| 309 | process_reset(rest); |
| 310 | } else { |
| 311 | WARNING("Unrecognized command: \"%s\"", command); |
| 312 | } |
| 313 | |
| 314 | return false; |
| 315 | } |
| 316 | |
| 317 | int command_mode = 0; |
| 318 | char *command_buffer = nullptr; |
no test coverage detected