diff options
author | Jie Zhang <jie.zhang@analog.com> | 2011-05-03 14:35:40 -0400 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2011-05-18 18:52:20 +0200 |
commit | ee124401a21f4dff3332f3f417b7bd2e67034cbc (patch) | |
tree | deeba4a09342c8a9e5909cc1161846ae1f567b74 | |
parent | 6d9f61fb6540612fc818d31bba2acce550449a7a (diff) | |
download | openocd_libswd-ee124401a21f4dff3332f3f417b7bd2e67034cbc.tar.gz openocd_libswd-ee124401a21f4dff3332f3f417b7bd2e67034cbc.tar.bz2 openocd_libswd-ee124401a21f4dff3332f3f417b7bd2e67034cbc.tar.xz openocd_libswd-ee124401a21f4dff3332f3f417b7bd2e67034cbc.zip |
Get register value if it's invalid in cache.
-rw-r--r-- | src/server/gdb_server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 9c1d2452..b29ee4f8 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1064,6 +1064,8 @@ static int gdb_get_registers_packet(struct connection *connection, for (i = 0; i < reg_list_size; i++) { + if (!reg_list[i]->valid) + reg_list[i]->type->get(reg_list[i]); gdb_str_to_target(target, reg_packet_p, reg_list[i]); reg_packet_p += DIV_ROUND_UP(reg_list[i]->size, 8) * 2; } @@ -1168,6 +1170,9 @@ static int gdb_get_register_packet(struct connection *connection, exit(-1); } + if (!reg_list[reg_num]->valid) + reg_list[reg_num]->type->get(reg_list[reg_num]); + reg_packet = malloc(DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2); gdb_str_to_target(target, reg_packet, reg_list[reg_num]); |