This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8198

-- gerrit

commit 05296eba04f9bc661d0640012168ab94a26bb15c
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Apr 6 00:26:38 2024 +0200

    target: cortex_m: fix display of DWT registers
    
    Commit 16b4b8cf5453 ("Cortex-M3: expose most DWT registers") added
    the DWT registers to the list of CPU registers.
    The commit message from 2009 reports the reason behind this odd
    mixing of CPU and DWT registers.
    This feature got broken in 2017 with the introduction of the field
    struct reg::exist and its further use in the code. As result, the
    command 'reg' on a target Cortex-M reports only the core registers
    and then the header line
            ===== Cortex-M DWT registers
    not anymore followed by the DWT registers.
    
    Fix it by tagging each DWT registers as existing.
    
    Change-Id: Iab026e7da8d6b8ba052514c3fd3b5cdfe301f330
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>
    Fixes: b5964191f0d2 ("register: support non-existent registers")

diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 4894cabf8b..a26df2e5a2 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -2351,6 +2351,7 @@ static void cortex_m_dwt_addreg(struct target *t, struct 
reg *r, const struct dw
        r->value = state->value;
        r->arch_info = state;
        r->type = &dwt_reg_type;
+       r->exist = true;
 }
 
 static void cortex_m_dwt_setup(struct cortex_m_common *cm, struct target 
*target)

-- 

Reply via email to