diff options
author | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-07-25 10:06:57 +0000 |
---|---|---|
committer | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-07-25 10:06:57 +0000 |
commit | 290e01c62afdfd5f6eb76a4caef266344510f2c0 (patch) | |
tree | d1bc200336f595ce782427f6c86724f7135aa16b /src/target | |
parent | 1429d2c659ab9b84dee673e7697da7eab44a8f90 (diff) | |
download | openocd_libswd-290e01c62afdfd5f6eb76a4caef266344510f2c0.tar.gz openocd_libswd-290e01c62afdfd5f6eb76a4caef266344510f2c0.tar.bz2 openocd_libswd-290e01c62afdfd5f6eb76a4caef266344510f2c0.tar.xz openocd_libswd-290e01c62afdfd5f6eb76a4caef266344510f2c0.zip |
- reformat src/jtag/bitq.c (thanks to Pavel Chromy)
- fix multiple reads from FT2232 into same buffer location (thanks to Magnus Lundin)
- retry JTAG chain validation (thanks to Magnus Lundin)
- reworked GDB packet input handling (thanks to Pavel Chromy)
- output error message when setting a watchpoint failed
- removed duplicate out-of-bounds check in at91sam7.c (thanks to Pavel Chromy)
git-svn-id: svn://svn.berlios.de/openocd/trunk@181 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/target.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/target/target.c b/src/target/target.c index 07c450cd..10d430b9 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1862,6 +1862,7 @@ int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char **args int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { target_t *target = get_current_target(cmd_ctx); + int retval; if (argc == 0) { @@ -1905,7 +1906,23 @@ int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, { data_mask = strtoul(args[4], NULL, 0); } - watchpoint_add(target, strtoul(args[0], NULL, 0), strtoul(args[1], NULL, 0), type, data_value, data_mask); + + if ((retval = watchpoint_add(target, strtoul(args[0], NULL, 0), + strtoul(args[1], NULL, 0), type, data_value, data_mask)) != ERROR_OK) + { + switch (retval) + { + case ERROR_TARGET_NOT_HALTED: + command_print(cmd_ctx, "target must be halted to set watchpoints"); + break; + case ERROR_TARGET_RESOURCE_NOT_AVAILABLE: + command_print(cmd_ctx, "no more watchpoints available"); + break; + default: + command_print(cmd_ctx, "unknown error, watchpoint not set"); + break; + } + } } else { |