Skip to content

Commit 13e4569

Browse files
committed
Fix gdb regs reference for Cortex-M
1 parent 7088d22 commit 13e4569

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

qiling/debugger/gdb/xml/arm/arm-m-profile.xml renamed to qiling/debugger/gdb/xml/cortex_m/arm-m-profile.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@
2525
<reg name="pc" bitsize="32" type="code_ptr"/>
2626

2727
<reg name="xpsr" bitsize="32" regnum="25"/>
28-
</feature>
28+
<reg name="msp" bitsize="32"/>
29+
<reg name="psp" bitsize="32"/>
30+
<reg name="primask" bitsize="32"/>
31+
<reg name="basepri" bitsize="32"/>
32+
<reg name="faultmask" bitsize="32"/>
33+
<reg name="control" bitsize="32"/>
34+
</feature>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!-- Copyright (C) 2009-2016 Free Software Foundation, Inc.
3+
4+
*!Copying and distribution of this file, with or without modification,
5+
*!are permitted in any medium without royalty provided the copyright
6+
*!notice and this notice are preserved. -->
7+
8+
<!DOCTYPE target SYSTEM "gdb-target.dtd">
9+
<target xmlns:xi="http://www.w3.org/2001/XInclude">
10+
<architecture>armv7-m</architecture>
11+
<xi:include href="arm-m-profile.xml"/>
12+
</target>

qiling/debugger/gdb/xmlregs.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313
reg_map_q as arm_regs_q,
1414
reg_map_s as arm_regs_s
1515
)
16+
17+
from qiling.arch.cortex_m_const import (
18+
reg_map as conretx_m_regs
19+
)
20+
1621
from qiling.arch.arm64_const import (
1722
reg_map as arm64_regs,
1823
reg_map_v as arm64_regs_v,
1924
reg_map_fp as arm64_reg_map_fp
2025
)
26+
2127
from qiling.arch.mips_const import (
2228
reg_map as mips_regs_gpr
2329
)
30+
2431
from qiling.arch.x86_const import (
2532
reg_map_32 as x86_regs_32,
2633
reg_map_64 as x86_regs_64,
@@ -133,7 +140,7 @@ def __load_regsmap(archtype: QL_ARCH, xmltree: ElementTree.ElementTree) -> Seque
133140
QL_ARCH.X86: dict(**x86_regs_32, **x86_regs_misc, **x86_regs_cr, **x86_regs_st, **x86_regs_xmm),
134141
QL_ARCH.X8664: dict(**x86_regs_64, **x86_regs_misc, **x86_regs_cr, **x86_regs_st, **x86_regs_xmm, **x86_regs_ymm),
135142
QL_ARCH.ARM: dict(**arm_regs, **arm_regs_vfp, **arm_regs_q, **arm_regs_s),
136-
QL_ARCH.CORTEX_M: arm_regs,
143+
QL_ARCH.CORTEX_M: dict(**conretx_m_regs),
137144
QL_ARCH.ARM64: dict(**arm64_regs, **arm64_regs_v, **arm64_reg_map_fp),
138145
QL_ARCH.MIPS: dict(**mips_regs_gpr)
139146
}[archtype]

0 commit comments

Comments
 (0)