aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
Diffstat (limited to 'src/target')
-rw-r--r--src/target/register.h2
-rw-r--r--src/target/target.c2
-rw-r--r--src/target/xscale.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/target/register.h b/src/target/register.h
index 7c53d6e..1bae811 100644
--- a/src/target/register.h
+++ b/src/target/register.h
@@ -134,6 +134,8 @@ struct reg {
bool valid;
/* When false, the register doesn't actually exist in the target. */
bool exist;
+ /* Hide the register from gdb and omit it in 'reg' cmd output */
+ bool hidden;
/* Size of the register in bits. */
uint32_t size;
/* Used for generating XML description of registers. Can be set to NULL for
diff --git a/src/target/target.c b/src/target/target.c
index 9d4fe77..3c1a633 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3037,7 +3037,7 @@ COMMAND_HANDLER(handle_reg_command)
for (i = 0, reg = cache->reg_list;
i < cache->num_regs;
i++, reg++, count++) {
- if (reg->exist == false)
+ if (reg->exist == false || reg->hidden)
continue;
/* only print cached values if they are valid */
if (reg->valid) {
diff --git a/src/target/xscale.c b/src/target/xscale.c
index aaaed0e..b25999d 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2882,7 +2882,7 @@ static void xscale_build_reg_cache(struct target *target)
/* fill in values for the xscale reg cache */
(*cache_p)->name = "XScale registers";
(*cache_p)->next = NULL;
- (*cache_p)->reg_list = malloc(num_regs * sizeof(struct reg));
+ (*cache_p)->reg_list = calloc(num_regs, sizeof(struct reg));
(*cache_p)->num_regs = num_regs;
for (i = 0; i < num_regs; i++) {