summaryrefslogtreecommitdiff
path: root/ao-tools/ao-rawload
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-12-15 23:58:29 -0800
committerKeith Packard <keithp@keithp.com>2009-12-15 23:58:29 -0800
commit7ac8efea5d60b81adccdc1e38ac4c13facfae7c9 (patch)
tree0e49fbcda19e842a63f3f8e3a3520dc3ecfae59d /ao-tools/ao-rawload
parent5481082b18226a0de6b377215b3b330bdbc4a6c6 (diff)
Add --cal to man page
Diffstat (limited to 'ao-tools/ao-rawload')
-rw-r--r--ao-tools/ao-rawload/ao-rawload.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c
index d9ee5718..0098b658 100644
--- a/ao-tools/ao-rawload/ao-rawload.c
+++ b/ao-tools/ao-rawload/ao-rawload.c
@@ -19,16 +19,18 @@
#include <unistd.h>
#include <getopt.h>
#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 <tty-name>] [--device <device-name>] file.ihx\n", program);
+ fprintf(stderr, "usage: %s [--tty <tty-name>] [--device <device-name>] [--run] file.ihx\n", program);
exit(1);
}
@@ -45,6 +47,7 @@ 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) {
switch (c) {
@@ -54,6 +57,9 @@ main (int argc, char **argv)
case 'D':
device = optarg;
break;
+ case 'r':
+ run = 1;
+ break;
default:
usage(argv[0]);
break;
@@ -105,6 +111,10 @@ main (int argc, char **argv)
ccdbg_close(dbg);
exit(1);
}
+ if (run) {
+ ccdbg_set_pc(dbg, image->address);
+ ccdbg_resume(dbg);
+ }
ccdbg_close(dbg);
exit (0);
}