diff options
author | Alistair Popple <alistair@popple.id.au> | 2018-05-25 13:09:22 +1000 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2018-05-25 13:09:22 +1000 |
commit | b825a4771776301f84e0a11608e90a0d770ee70c (patch) | |
tree | 61ad2aa00a753a577335d35f769909c552582f86 /src/main.c | |
parent | 77ce963c113ee9708d1ab98960448aae7a2b1bb9 (diff) | |
download | pdbg-b825a4771776301f84e0a11608e90a0d770ee70c.tar.gz pdbg-b825a4771776301f84e0a11608e90a0d770ee70c.zip |
Remove "expert" mode
Based on feedback it seems "expert" mode was too vague and confusing for users,
so remove it. This means the user will be forced to manually manage the state of
the system which also seems to be too confusing for some users, but a future
patch will add user-friendly commands to the application which will change the
system state as required.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 32 |
1 files changed, 4 insertions, 28 deletions
@@ -87,7 +87,7 @@ struct action { int (*fn)(int, int, char **); }; -static struct action expert_actions[] = { +static struct action actions[] = { { "getgpr", "<gpr>", "Read General Purpose Register (GPR)", &handle_gpr }, { "putgpr", "<gpr> <value>", "Write General Purpose Register (GPR)", &handle_gpr }, { "getnia", "", "Get Next Instruction Address (NIA)", &handle_nia }, @@ -109,9 +109,6 @@ static struct action expert_actions[] = { { "htm_analyse", "", "[derepcated use 'htm nest analyse'] Stop and dump buffer to file", &run_htm_analyse }, { "htm", "core|nest start|stop|status|reset|dump|trace|analyse", "Hardware Trace Macro", &run_htm }, { "release", "", "Should be called after pdbg work is finished, to release special wakeups and other resources.", &handle_release}, -}; - -static struct action actions[] = { { "probe", "", "", &handle_probe }, { "getcfam", "<address>", "Read system cfam", &handle_cfams }, { "putcfam", "<address> <value> [<mask>]", "Write system cfam", &handle_cfams }, @@ -152,18 +149,12 @@ static void print_usage(char *pname) printf("\t\tand defaults to 0x50 for I2C\n"); printf("\t-D, --debug=<debug level>\n"); printf("\t\t0:error (default) 1:warning 2:notice 3:info 4:debug\n"); - printf("\t-E, --expert\n"); printf("\t-V, --version\n"); printf("\t-h, --help\n"); printf("\n"); printf(" Commands:\n"); for (i = 0; i < ARRAY_SIZE(actions); i++) printf(" %-15s %-27s %s\n", actions[i].name, actions[i].args, actions[i].desc); - if (pdbg_expert_mode) { - printf(" Expert Commands:\n"); - for (i = 0; i < ARRAY_SIZE(expert_actions); i++) - printf(" %-15s %-27s %s\n", expert_actions[i].name, expert_actions[i].args, expert_actions[i].desc); - } } static bool parse_options(int argc, char *argv[]) @@ -182,13 +173,12 @@ static bool parse_options(int argc, char *argv[]) {"thread", required_argument, NULL, 't'}, {"debug", required_argument, NULL, 'D'}, {"version", no_argument, NULL, 'V'}, - {"expert", no_argument, NULL, 'E'}, {NULL, 0, NULL, 0} }; char *endptr; do { - c = getopt_long(argc, argv, "+ab:c:d:hp:s:t:D:VE", long_opts, NULL); + c = getopt_long(argc, argv, "+ab:c:d:hp:s:t:D:V", long_opts, NULL); if (c == -1) break; @@ -280,11 +270,6 @@ static bool parse_options(int argc, char *argv[]) exit(0); break; - case 'E': - opt_error = false; - pdbg_expert_mode = true; - break; - case '?': case 'h': opt_error = true; @@ -577,7 +562,7 @@ static int handle_probe(int optind, int argc, char *argv[]) } /* - * Release handler for !pdbg_expert_mode + * Release handler. */ static void atexit_release(void) { @@ -623,8 +608,7 @@ int main(int argc, char *argv[]) if (target_selection()) return 1; - if (!pdbg_expert_mode) - atexit(atexit_release); + atexit(atexit_release); for (i = 0; i < ARRAY_SIZE(actions); i++) { if (strcmp(argv[optind], actions[i].name) == 0) { @@ -632,14 +616,6 @@ int main(int argc, char *argv[]) goto found_action; } } - if (pdbg_expert_mode) { - for (i = 0; i < ARRAY_SIZE(expert_actions); i++) { - if (strcmp(argv[optind], expert_actions[i].name) == 0) { - rc = expert_actions[i].fn(optind, argc, argv); - goto found_action; - } - } - } PR_ERROR("Unsupported command: %s\n", argv[optind]); print_usage(basename(argv[0])); |