X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-rawload%2Fao-rawload.c;h=a4746b195411ac8d73bb237774f12cea3020b808;hp=255f63eca2f7c99563cbd629c0bd14b969e63e1e;hb=5d7a3a5fbc0af4621c67a6fd51a9c9d5ae688fa5;hpb=35c54b3a278fa9bc2bc7f4b5ee04866697c93ba0 diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c index 255f63ec..a4746b19 100644 --- a/ao-tools/ao-rawload/ao-rawload.c +++ b/ao-tools/ao-rawload/ao-rawload.c @@ -19,16 +19,18 @@ #include #include #include "ccdbg.h" +#include "cc.h" static const struct option options[] = { { .name = "tty", .has_arg = 1, .val = 'T' }, { .name = "device", .has_arg = 1, .val = 'D' }, + { .name = "run", .has_arg = 0, .val = 'r' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--tty ] [--device ] file.ihx\n", program); + fprintf(stderr, "usage: %s [--tty ] [--device ] [--run] file.ihx\n", program); exit(1); } @@ -45,8 +47,9 @@ main (int argc, char **argv) char *tty = NULL; char *device = NULL; int c; + int run = 0; - while ((c = getopt_long(argc, argv, "T:D:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "rT:D:", options, NULL)) != -1) { switch (c) { case 'T': tty = optarg; @@ -54,6 +57,9 @@ main (int argc, char **argv) case 'D': device = optarg; break; + case 'r': + run = 1; + break; default: usage(argv[0]); break; @@ -61,7 +67,7 @@ main (int argc, char **argv) } filename = argv[optind]; if (filename == NULL) { - fprintf(stderr, "usage: %s \n", argv[0]); + usage(argv[0]); exit(1); } file = fopen(filename, "r"); @@ -105,8 +111,10 @@ main (int argc, char **argv) ccdbg_close(dbg); exit(1); } - ccdbg_set_pc(dbg, image->address); - ccdbg_resume(dbg); + if (run) { + ccdbg_set_pc(dbg, image->address); + ccdbg_resume(dbg); + } ccdbg_close(dbg); exit (0); }