Skip to content

Commit 451d793

Browse files
adamgreenfacchinm
authored andcommitted
Pull ARMv7-M code back in
This adds basic breakpoint/watchpoint support. Changes include: * Moved context state into scatter gather structure instead of mriCortexMState structure instead of the straight up array used before. Update armv7-m.c to make use of this new context format. * Added fields to mriCortexMState to hold the value of the SP pointed to in the context scatter gather structure. Also added fields to track the fault cause such as exceptionNumber, DFSR, HFSR, etc. since for ThreadMRI it is better to capture these earlier in the exception handler before handing off to the main debugger thread as was done before in armv7-m.c Not a bad idea to do it earlier in the case of handler mode MRI either. * I will still need to do some work to get all of this working in the original MRI, handler mode code base. * Handler mode MRI will still include system registers like MSP, PSP, etc. in the context while ThreadMRI will not. * In mriCortexMInit(), skip the setting of SVCall, SysTick, and PendSV priorities for ThreadMRI. ThreadMRI also sets DebugMon to the lowest priority while handler mode MRI sets it to the highest priority. * I updated code to use existing Platform_Get/SetProgramCounter() to manipulate the value of the PC register than grabbing it directly from the context which is now a bit more involved as it has to go through the scatter gather data structure. * I haven't figured out how to implement single stepping in ThreadMRI so I have disabled it for now. This will be one of my next projects. * Renamed global symbols to use "mri" prefix instead of "__mri" like I had already done in the other modules.
1 parent c149e46 commit 451d793

File tree

4 files changed

+192
-488
lines changed

4 files changed

+192
-488
lines changed

libraries/ThreadMRI/examples/ThreadMRI/ThreadMRI.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ void setup() {
1313
// UNDONE: Using Serial1 for now to unblock my progress.
1414
Serial1.begin(115200);
1515
g_debugger.debugException();
16-
testContext();
16+
//testContext();
17+
__debugbreak();
1718
}
1819

1920
void loop() {

0 commit comments

Comments
 (0)