target, register: allow a register hidden from gdb and 'reg' cmd
authorTomas Vanek <vanekt@fbl.cz>
Sun, 20 Oct 2019 07:40:34 +0000 (09:40 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 15 Nov 2020 21:05:37 +0000 (21:05 +0000)
commitf8453ae52cf336c337b7f135f10ed4afecf35a7c
tree7b472b480246a3519ed0de37f4394ee3957ce15f
parent109dc1975f25a36a501811e48267b17d7dc19688
target, register: allow a register hidden from gdb and 'reg' cmd

Introduce a 'hidden' flag in struct reg to support a register cache
containing different views of same data: e.g. Cortex-M has
primask, basepri, faultmask and control registers accessed
as one word. With the hidden flag we can add an reg_list item
corresponding to hw access without exposing the register to user level.

All the struct reg are allocated with calloc() but one in xscale.c
allocated by malloc(). Change this one to use calloc() as well
to guarantee initial value hidden=false

Change-Id: I8da9f5a5a60777ae7ef943a841307487bd80fc6f
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5325
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/server/gdb_server.c
src/target/register.h
src/target/target.c
src/target/xscale.c