]> git.sur5r.net Git - openocd/commitdiff
Get register value if it's invalid in cache.
authorJie Zhang <jie.zhang@analog.com>
Tue, 3 May 2011 18:35:40 +0000 (14:35 -0400)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 18 May 2011 16:52:20 +0000 (18:52 +0200)
src/server/gdb_server.c

index 9c1d24529645bb0d96063bf8cb57b225f26984df..b29ee4f84f3fd090251a62defe4582cc0485d05d 100644 (file)
@@ -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]);