/* get register arch_type, and call set method */
arch_type = register_get_arch_type(reg_list[i]->arch_type);
- if (arch_type == NULL)
- {
- LOG_ERROR("BUG: encountered unregistered arch type");
- exit(-1);
- }
+
arch_type->set(reg_list[i], bin_buf);
/* advance packet pointer */
/* get register arch_type, and call set method */
arch_type = register_get_arch_type(reg_list[reg_num]->arch_type);
- if (arch_type == NULL)
- {
- LOG_ERROR("BUG: encountered unregistered arch type");
- exit(-1);
- }
arch_type->set(reg_list[reg_num], bin_buf);
gdb_put_packet(connection, "OK", 2);
{
int i;
reg_cache_t *cache = first;
-
+
while (cache)
{
for (i = 0; i < cache->num_regs; i++)
if (strcmp(cache->reg_list[i].name, name) == 0)
return &(cache->reg_list[i]);
}
-
+
if (search_all)
cache = cache->next;
else
break;
}
-
+
return NULL;
}
reg_cache_t** register_get_last_cache_p(reg_cache_t **first)
{
reg_cache_t **cache_p = first;
-
+
if (*cache_p)
while (*cache_p)
cache_p = &((*cache_p)->next);
else
return first;
-
+
return cache_p;
}
{
reg_arch_type_t** arch_type_p = ®_arch_types;
int id = 0;
-
+
if (*arch_type_p)
{
while (*arch_type_p)
arch_type_p = &((*arch_type_p)->next);
}
}
-
+
(*arch_type_p) = malloc(sizeof(reg_arch_type_t));
(*arch_type_p)->id = id + 1;
(*arch_type_p)->set = set;
(*arch_type_p)->get = get;
(*arch_type_p)->next = NULL;
-
+
return id + 1;
}
reg_arch_type_t* register_get_arch_type(int id)
{
reg_arch_type_t *arch_type = reg_arch_types;
-
+
while (arch_type)
{
if (arch_type->id == id)
return arch_type;
arch_type = arch_type->next;
}
-
+ LOG_ERROR("BUG: encountered unregistered arch type 0x%08x", id);
+ exit(-1);
return NULL;
}
}
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)
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);
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);