Hi All,

Using any Cortex-M device, when the flash is empty (boot from flash) the
core enters in lockup state.
in lockup state PC value is 0xFFFFFFFx according to
https://developer.arm.com/documentation/ka001181/latest

when, gdb attaches to openocd it tries to unwind the stack,
The expected behavior is that gdb should not unwind the stack when the core
is in lock-up

Unfortunately, in gdb some values are not considered as "magic" : ref
https://github.com/bminor/binutils-gdb/blob/317db249c7a361aa6e723fefc09116fd9cd75978/gdb/arm-tdep.c#L542

I have reported this issue in gdb bugzilla:
https://sourceware.org/bugzilla/show_bug.cgi?id=28549
More details are available in the ticket.

IMO: arm_m_addr_is_magic could be changed to return 1 if (addr & 0xf0000000
== 0xf0000000)

Furthermore, I think that the current implementation of arm_m_addr_is_magic
is incorrect, since it considers the special values of EXC_RETURN which are
loaded in the LR register and not the PC reg.

Please do not hesitate to comment and share your feedback.

Regards,
Tarek


Reply via email to