register: support non-existent registers
This patch fixes a number of bugs caused by incomplete support for non-existent registers. This is needed for targets that provide optional registers or non-linear register numbers. Change-Id: I216196e0051f28887a2c3da410959382369eed80 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/4113 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
committed by
Matthias Welwarsky
parent
06589d2de4
commit
b5964191f0
@@ -1179,8 +1179,11 @@ static int gdb_get_registers_packet(struct connection *connection,
|
||||
if (retval != ERROR_OK)
|
||||
return gdb_error(connection, retval);
|
||||
|
||||
for (i = 0; i < reg_list_size; i++)
|
||||
for (i = 0; i < reg_list_size; i++) {
|
||||
if (reg_list[i] == NULL || reg_list[i]->exist == false)
|
||||
continue;
|
||||
reg_packet_size += DIV_ROUND_UP(reg_list[i]->size, 8) * 2;
|
||||
}
|
||||
|
||||
assert(reg_packet_size > 0);
|
||||
|
||||
@@ -1191,6 +1194,8 @@ static int gdb_get_registers_packet(struct connection *connection,
|
||||
reg_packet_p = reg_packet;
|
||||
|
||||
for (i = 0; i < reg_list_size; i++) {
|
||||
if (reg_list[i] == NULL || reg_list[i]->exist == false)
|
||||
continue;
|
||||
if (!reg_list[i]->valid) {
|
||||
retval = reg_list[i]->type->get(reg_list[i]);
|
||||
if (retval != ERROR_OK && gdb_report_register_access_error) {
|
||||
|
||||
Reference in New Issue
Block a user