Skip to content

cortexm : mistmatch between gdb regnum and internal logic #2099

@mean00

Description

@mean00

Hi,
There seems to be several issues when matching the gdb representation of the registers and the internal representation.
1- xPSR is forced to be 25, leaving a gap in the gdb register numbering (16->25). That breaks the conversion between regnum and actual register index >= xPSR (that's relevant when reading/writing a single register). msp and psp cannot be set individually for example.

2- Similarily, the matching is problematic due to optional registers such as basepri.
Trustzone is simply offset by CORTEXM_GENERAL_REGCOUNT (20), while the value is actually ~22 for cortex m33.

The first one is easy to fix, but it looks difficult to do a simple/quick fix for the 2nd one that works for cortex M0 and M33 without rewriting a significant part of the logic.

An option would be to have more gaps in the registers, so that a given register is always at the same place/index whatever the chip is, rather than strictly following the registers that are present on the current chip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions