summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Bur <cyrilbur@gmail.com>2018-02-09 15:38:47 +1100
committerAlistair Popple <alistair@popple.id.au>2018-02-16 16:22:23 +1100
commit6540cf2e957a070928afe86cd28af5aa4a151125 (patch)
tree86f32816ff7471988d17a078be81860c3e566faa
parent8a3cdf341a9ca41479e377f4d6c09f74b53ce381 (diff)
downloadpdbg-6540cf2e957a070928afe86cd28af5aa4a151125.tar.gz
pdbg-6540cf2e957a070928afe86cd28af5aa4a151125.zip
main: Use new command handling for probe
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
-rw-r--r--src/main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index a38472e..45a32ab 100644
--- a/src/main.c
+++ b/src/main.c
@@ -78,6 +78,8 @@ static int **processorsel[MAX_PROCESSORS];
static int *chipsel[MAX_PROCESSORS][MAX_CHIPS];
static int threadsel[MAX_PROCESSORS][MAX_CHIPS][MAX_THREADS];
+static int handle_probe(int optind, int argc, char *argv[]);
+
static struct {
const char *name;
const char *args;
@@ -110,6 +112,7 @@ static struct {
{ "htm_dump", "", "Dump HTM buffer to file", &run_htm_dump },
{ "htm_trace", "" , "Configure and start tracing with HTM", &run_htm_trace },
{ "htm_analyse", "", "Stop and dump buffer to file", &run_htm_analyse },
+ { "probe", "", "", &handle_probe },
};
static void print_usage(char *pname)
@@ -535,9 +538,20 @@ void print_target(struct pdbg_target *target, int level)
print_target(next, level + 1);
}
-int main(int argc, char *argv[])
+static int handle_probe(int optind, int argc, char *argv[])
{
struct pdbg_target *target;
+
+ pdbg_for_each_class_target("pib", target)
+ print_target(target, 0);
+
+ printf("\nNote that only selected targets will be shown above. If none are shown\n"
+ "try adding '-a' to select all targets\n");
+ return 1;
+}
+
+int main(int argc, char *argv[])
+{
bool found = true;
int i, rc = 0;
@@ -559,14 +573,6 @@ int main(int argc, char *argv[])
return -1;
switch(cmd) {
- case PROBE:
- rc = 1;
- pdbg_for_each_class_target("pib", target)
- print_target(target, 0);
-
- printf("\nNote that only selected targets will be shown above. If none are shown\n"
- "try adding '-a' to select all targets\n");
- break;
default:
found = false;
break;
OpenPOWER on IntegriCloud