Skip to content

Commit d0263d7

Browse files
committed
Add thread state support for continue,step,detach
Usually GDB will use vCont for continue and single stepping if threads are supported but it is probably best to have the simpler continue ('c' and 'C') and step ('s' and 'S') GDB command handler makes calls to Platform_RtosSetThreadState() if it is supported. The detach handler needs to call Platform_RtosSetThreadState() as well.
1 parent 1dbfa6a commit d0263d7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

libraries/MRI/src/core/cmd_continue.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static int shouldSkipHardcodedBreakpoint(void);
2525
static int isCurrentInstructionHardcodedBreakpoint(void);
2626
uint32_t ContinueExecution(int setPC, uint32_t newPC)
2727
{
28+
if (Platform_RtosIsSetThreadStateSupported())
29+
Platform_RtosSetThreadState(MRI_PLATFORM_ALL_THREADS, MRI_PLATFORM_THREAD_THAWED);
2830
uint32_t returnValue = SkipHardcodedBreakpoint();
2931
if (setPC)
3032
Platform_SetProgramCounter(newPC);
@@ -124,6 +126,8 @@ uint32_t HandleContinueWithSignalCommand(void)
124126
*/
125127
uint32_t HandleDetachCommand(void)
126128
{
129+
if (Platform_RtosIsSetThreadStateSupported())
130+
Platform_RtosSetThreadState(MRI_PLATFORM_ALL_THREADS, MRI_PLATFORM_THREAD_THAWED);
127131
SkipHardcodedBreakpoint();
128132
PrepareStringResponse("OK");
129133
return HANDLER_RETURN_RESUME_PROGRAM;

libraries/MRI/src/core/cmd_step.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ uint32_t HandleSingleStepCommand(void)
4040
}
4141

4242
if (returnValue)
43+
{
44+
if (Platform_RtosIsSetThreadStateSupported())
45+
Platform_RtosSetThreadState(Platform_RtosGetHaltedThreadId(), MRI_PLATFORM_THREAD_SINGLE_STEPPING);
4346
Platform_EnableSingleStep();
47+
}
4448

4549
return returnValue;
4650
}
@@ -71,7 +75,11 @@ uint32_t HandleSingleStepWithSignalCommand(void)
7175
}
7276

7377
if (returnValue)
78+
{
79+
if (Platform_RtosIsSetThreadStateSupported())
80+
Platform_RtosSetThreadState(Platform_RtosGetHaltedThreadId(), MRI_PLATFORM_THREAD_SINGLE_STEPPING);
7481
Platform_EnableSingleStep();
82+
}
7583

7684
return returnValue;
7785
}

libraries/MRI/src/core/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define MRI_VERSION_MAJOR 1
88
#define MRI_VERSION_MINOR 1
9-
#define MRI_VERSION_BUILD 20200510
9+
#define MRI_VERSION_BUILD 20200511
1010
#define MRI_VERSION_SUBBUILD 0
1111

1212
#define MRI_STR(X) MRI_STR2(X)

0 commit comments

Comments
 (0)