|
From: Edwin O. <eo...@mi...> - 2008-04-17 22:16:32
|
I'm attaching a patch that improves breakpoint handling on cortex-m3 parts. Specifically, this patch allows expressions to be evaluated in GDB that contain function calls. It does two things in order to make this work: 1) Forces all breakpoints to be of length 2. GDB creates breakpoints with length=4, and I don't know why. My solution may not be correct here, and should be checked by someone who understands this better. (The patch does seem to work, however!) 2) It forces all writes to the link register (R14 aka LR) to have the LSB set, thus marking the return address as containing thumb code. This is necessary because GDB tries to set a return address LR=0, which causes an INVSTATE exception. Perhaps some of these would be better fixed in GDB, but that code is scary! -Ed |