Skip to content

Commit

Permalink
gdb/arm: fix IPSR field test in arm_m_exception_cache ()
Browse files Browse the repository at this point in the history
Arm v8-M Architecture Reference Manual,
D1.2.141 IPSR, Interrupt Program Status Register reads
"Exception, bits [8:0]"

9 bits, not 8! It is uncommon but true!

Signed-off-by: Tomas Vanek <[email protected]>
  • Loading branch information
luis-machado-arm committed Oct 26, 2022
1 parent 8b73ee2 commit b2e9e75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdb/arm-tdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3441,7 +3441,7 @@ arm_m_exception_cache (frame_info_ptr this_frame)
}

ULONGEST xpsr = get_frame_register_unsigned (this_frame, ARM_PS_REGNUM);
if ((xpsr & 0xff) != 0)
if ((xpsr & 0x1ff) != 0)
/* Handler mode: This is the mode that exceptions are handled in. */
arm_cache_switch_prev_sp (cache, tdep, tdep->m_profile_msp_s_regnum);
else
Expand Down

0 comments on commit b2e9e75

Please sign in to comment.