Skip to content

feat: add qdb riscv support - #1651

Open
Jvlegod wants to merge 2 commits into
qilingframework:devfrom
Jvlegod:feature/qdb-riscv
Open

feat: add qdb riscv support#1651
Jvlegod wants to merge 2 commits into
qilingframework:devfrom
Jvlegod:feature/qdb-riscv

Conversation

@Jvlegod

@Jvlegod Jvlegod commented Aug 4, 2026

Copy link
Copy Markdown

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


Feature

b69128f add QDB support for RISC-V 32/64(also with tests).

Fix

718280f fixes trailing register row rendering.

Testing revealed that the issue primarily occurs on ARM Cortex-M and RISC-V 32/64.

For example(ARM Cortex-M):

Before fix:

r0       : 0x00000000	r1       : 0x00000000	r2       : 0x00000000	r3       : 0x00000000
r4       : 0x00000000	r5       : 0x00000000	r6       : 0x00000000	r7       : 0x00000000
r8       : 0x00000000	sb       : 0x00000000	sl       : 0x00000000	fp       : 0x00000000
ip       : 0x00000000	sp       : 0x20020000	lr       : 0xffffffff	pc       : 0x08001308
xpsr     : 0x41000000	control  : 0x00000000	primask  : 0x00000000	basepri  : 0x00000000
[? mode] [flags: thumb fiq irq overflow carry ZERO neg]

After fix:

r0       : 0x00000000	r1       : 0x00000000	r2       : 0x00000000	r3       : 0x00000000
r4       : 0x00000000	r5       : 0x00000000	r6       : 0x00000000	r7       : 0x00000000
r8       : 0x00000000	sb       : 0x00000000	sl       : 0x00000000	fp       : 0x00000000
ip       : 0x00000000	sp       : 0x20020000	lr       : 0xffffffff	pc       : 0x08001308
xpsr     : 0x00000000	control  : 0x00000000	primask  : 0x00000000	basepri  : 0x00000000
faultmask: 0x00000000
[? mode] [flags: thumb fiq irq overflow carry zero neg]

Reason: in ARM Cortex-M:

......
        regs = (
            'r0', 'r1', 'r2', 'r3',
            'r4', 'r5', 'r6', 'r7',
            'r8', 'r9', 'r10', 'r11',
            'r12', 'sp', 'lr', 'pc'
        )
......
class ArchCORTEX_M(ArchARM):
    _flags_reg: ClassVar[str] = 'xpsr'

    def __init__(self):
        super().__init__()

        self._regs += (
            'xpsr', 'control', 'primask',
            'basepri', 'faultmask'
        )

However, 21 % 4 == 1.

Jvlegod added 2 commits August 4, 2026 16:40
Signed-off-by: Jvle <keke.oerv@isrc.iscas.ac.cn>
Signed-off-by: Jvle <keke.oerv@isrc.iscas.ac.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant