Centralize error handling for buggy register handling

git-svn-id: svn://svn.berlios.de/openocd/trunk@1019 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe
2008-10-06 12:09:27 +00:00
parent 7b369df52c
commit 7fd9ba22ba
3 changed files with 13 additions and 32 deletions

View File

@@ -1212,7 +1212,7 @@ int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32*
}
if ((retval = target->type->checksum_memory(target, address,
size, &checksum)) == ERROR_TARGET_RESOURCE_NOT_AVAILABLE)
size, &checksum)) != ERROR_OK)
{
buffer = malloc(size);
if (buffer == NULL)
@@ -1625,11 +1625,6 @@ int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args
if (reg->valid == 0)
{
reg_arch_type_t *arch_type = register_get_arch_type(reg->arch_type);
if (arch_type == NULL)
{
LOG_ERROR("BUG: encountered unregistered arch type");
return ERROR_OK;
}
arch_type->get(reg);
}
value = buf_to_str(reg->value, reg->size, 16);
@@ -1645,12 +1640,6 @@ int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args
str_to_buf(args[1], strlen(args[1]), buf, reg->size, 0);
reg_arch_type_t *arch_type = register_get_arch_type(reg->arch_type);
if (arch_type == NULL)
{
LOG_ERROR("BUG: encountered unregistered arch type");
return ERROR_OK;
}
arch_type->set(reg, buf);
value = buf_to_str(reg->value, reg->size, 16);