diff options
author | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-06-14 09:47:00 +0000 |
---|---|---|
committer | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-06-14 09:47:00 +0000 |
commit | 53d1f9b2ca5718e4996e9cf3406f857d0ed26df2 (patch) | |
tree | 76c0dbf27a9114fb6f8a4c9f71af6117716a05d5 /src/target/target.c | |
parent | 7087b66f19a7d60025f7315baa26d682804f3640 (diff) |
- added manpage for OpenOCD (thanks to Uwe Hermann)
- fixed bug in ARM926EJ-S cache handling that caused cache linefills to be disabled after first debug entry
- added support for auto image type detection (thanks to Vincent Palatin)
- further work on ETM trace decoding (tested with a ETB interface using an ETM in normal 16-bit port mode, still experimental)
git-svn-id: svn://svn.berlios.de/openocd/trunk@169 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.c')
-rw-r--r-- | src/target/target.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/target/target.c b/src/target/target.c index fd8ffd7b..3797c3cf 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1654,7 +1654,6 @@ int handle_mw_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int handle_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - u32 address; u8 *buffer; u32 buf_cnt; u32 image_size; @@ -1668,22 +1667,28 @@ int handle_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char target_t *target = get_current_target(cmd_ctx); - if (argc < 2) + if (argc < 1) { - command_print(cmd_ctx, "usage: load_image <filename> <address> [type]"); + command_print(cmd_ctx, "usage: load_image <filename> [address] [type]"); return ERROR_OK; } - identify_image_type(&image.type, (argc == 3) ? args[2] : NULL); - - image.base_address_set = 1; - image.base_address = strtoul(args[1], NULL, 0); + /* a base address isn't always necessary, default to 0x0 (i.e. don't relocate) */ + if (argc >= 2) + { + image.base_address_set = 1; + image.base_address = strtoul(args[1], NULL, 0); + } + else + { + image.base_address_set = 0; + } image.start_address_set = 0; duration_start_measure(&duration); - if (image_open(&image, args[0], FILEIO_READ) != ERROR_OK) + if (image_open(&image, args[0], (argc >= 3) ? args[2] : NULL) != ERROR_OK) { command_print(cmd_ctx, "load_image error: %s", image.error_str); return ERROR_OK; |