Skip to content

Commit 4a34aef

Browse files
authored
Fix: gdb cannot parse some regs value when debugging ARM64 (#1526)
* Add arm64 regs
1 parent 1730d8a commit 4a34aef

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

qiling/arch/arm64.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def regs(self) -> QlRegisterManager:
4545
**arm64_const.reg_map_q,
4646
**arm64_const.reg_map_s,
4747
**arm64_const.reg_map_w,
48-
**arm64_const.reg_map_v
48+
**arm64_const.reg_map_v,
49+
**arm64_const.reg_map_fp
4950
)
5051

5152
pc_reg = 'pc'

qiling/arch/arm64_const.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"pc": UC_ARM64_REG_PC,
6969
"lr": UC_ARM64_REG_LR,
7070
"cpacr_el1": UC_ARM64_REG_CPACR_EL1,
71+
"pstate": UC_ARM64_REG_PSTATE,
7172
}
7273

7374
reg_map_b = {
@@ -313,3 +314,8 @@
313314
"v30": UC_ARM64_REG_V30,
314315
"v31": UC_ARM64_REG_V31
315316
}
317+
318+
reg_map_fp = {
319+
"fpcr": UC_ARM64_REG_FPCR,
320+
"fpsr": UC_ARM64_REG_FPSR
321+
}

qiling/debugger/gdb/xmlregs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
)
1616
from qiling.arch.arm64_const import (
1717
reg_map as arm64_regs,
18-
reg_map_v as arm64_regs_v
18+
reg_map_v as arm64_regs_v,
19+
reg_map_fp as arm64_reg_map_fp
1920
)
2021
from qiling.arch.mips_const import (
2122
reg_map as mips_regs_gpr
@@ -133,7 +134,7 @@ def __load_regsmap(archtype: QL_ARCH, xmltree: ElementTree.ElementTree) -> Seque
133134
QL_ARCH.X8664: dict(**x86_regs_64, **x86_regs_misc, **x86_regs_cr, **x86_regs_st, **x86_regs_xmm, **x86_regs_ymm),
134135
QL_ARCH.ARM: dict(**arm_regs, **arm_regs_vfp, **arm_regs_q, **arm_regs_s),
135136
QL_ARCH.CORTEX_M: arm_regs,
136-
QL_ARCH.ARM64: dict(**arm64_regs, **arm64_regs_v),
137+
QL_ARCH.ARM64: dict(**arm64_regs, **arm64_regs_v, **arm64_reg_map_fp),
137138
QL_ARCH.MIPS: dict(**mips_regs_gpr)
138139
}[archtype]
139140

0 commit comments

Comments
 (0)