Skip to content

Commit cfc6d81

Browse files
committed
Merge branch 'main' of https://github.com/nanoframework/nf-interpreter into develop
2 parents 99d3245 + 9f60398 commit cfc6d81

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

azure-pipelines.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,13 @@ jobs:
866866
867867
- template: azure-pipelines-templates/install-nuget.yml@templates
868868

869+
- task: Cache@2
870+
displayName: Cache NuGet packages
871+
continueOnError: true
872+
inputs:
873+
key: 'nuget | **/targets/netcore/nanoFramework.nanoCLR.Host/packages.lock.json | **/targets/netcore/nanoFramework.nanoCLR.CLI/packages.lock.json'
874+
path: $(UserProfile)/.nuget/packages
875+
869876
- task: DotNetCoreCLI@2
870877
displayName: Restore NuGet packages
871878
inputs:
@@ -1069,6 +1076,13 @@ jobs:
10691076

10701077
- template: azure-pipelines-templates/install-nuget.yml@templates
10711078

1079+
- task: Cache@2
1080+
displayName: Cache NuGet packages
1081+
continueOnError: true
1082+
inputs:
1083+
key: 'nuget | **/targets/netcore/nanoFramework.nanoCLR.Host/packages.lock.json | **/targets/netcore/nanoFramework.nanoCLR.CLI/packages.lock.json'
1084+
path: $(UserProfile)/.nuget/packages
1085+
10721086
- task: DotNetCoreCLI@2
10731087
displayName: Restore NuGet packages
10741088
inputs:

src/CLR/Debugger/Debugger.cpp

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,18 @@ bool CLR_DBG_Debugger::Monitor_WriteMemory(WP_Message *msg)
998998
{
999999
NATIVE_PROFILE_CLR_DEBUGGER();
10001000

1001-
auto *cmd = (CLR_DBG_Commands_Monitor_WriteMemory *)msg->m_payload;
1002-
CLR_DBG_Commands_Monitor_WriteMemory_Reply errorCode = AccessMemoryErrorCode_NoError;
1001+
CLR_DBG_Commands_Monitor_WriteMemory *cmd = (CLR_DBG_Commands_Monitor_WriteMemory *)msg->m_payload;
1002+
CLR_DBG_Commands_Monitor_WriteMemory_Reply cmdReply;
1003+
uint32_t errorCode;
10031004

1005+
// command reply is to be loaded with the error code and sent back to the caller
10041006
g_CLR_DBG_Debugger->AccessMemory(cmd->address, cmd->length, cmd->data, AccessMemory_Write, &errorCode);
10051007

1006-
WP_ReplyToCommand(msg, true, false, &errorCode, sizeof(errorCode));
1008+
// copy over the error code to the command reply
1009+
cmdReply = errorCode;
1010+
1011+
// the execution of this command is always successful, and the reply carries the error code
1012+
WP_ReplyToCommand(msg, true, false, &cmdReply, sizeof(cmdReply));
10071013

10081014
return true;
10091015
}
@@ -1012,13 +1018,17 @@ bool CLR_DBG_Debugger::Monitor_CheckMemory(WP_Message *msg)
10121018
{
10131019
NATIVE_PROFILE_CLR_DEBUGGER();
10141020

1015-
auto *cmd = (CLR_DBG_Commands_Monitor_CheckMemory *)msg->m_payload;
1016-
CLR_DBG_Commands_Monitor_CheckMemory_Reply errorCode = AccessMemoryErrorCode_NoError;
1021+
CLR_DBG_Commands_Monitor_CheckMemory *cmd = (CLR_DBG_Commands_Monitor_CheckMemory *)msg->m_payload;
1022+
CLR_DBG_Commands_Monitor_CheckMemory_Reply cmdReply;
1023+
uint32_t errorCode;
10171024

1025+
// access memory execution will load the command reply with the error code
10181026
g_CLR_DBG_Debugger
1019-
->AccessMemory(cmd->address, cmd->length, (unsigned char *)&errorCode, AccessMemory_Check, &errorCode);
1027+
->AccessMemory(cmd->address, cmd->length, (unsigned char *)&cmdReply, AccessMemory_Check, &errorCode);
10201028

1021-
WP_ReplyToCommand(msg, errorCode == AccessMemoryErrorCode_NoError, false, &errorCode, sizeof(errorCode));
1029+
// the execution of this command will fail if there is an error code, never the less, the error code is returned to
1030+
// the caller
1031+
WP_ReplyToCommand(msg, errorCode == AccessMemoryErrorCode_NoError, false, &cmdReply, sizeof(cmdReply));
10221032

10231033
return true;
10241034
}
@@ -1027,12 +1037,18 @@ bool CLR_DBG_Debugger::Monitor_EraseMemory(WP_Message *msg)
10271037
{
10281038
NATIVE_PROFILE_CLR_DEBUGGER();
10291039

1030-
auto *cmd = (CLR_DBG_Commands_Monitor_EraseMemory *)msg->m_payload;
1031-
CLR_DBG_Commands_Monitor_EraseMemory_Reply errorCode = AccessMemoryErrorCode_NoError;
1040+
CLR_DBG_Commands_Monitor_EraseMemory *cmd = (CLR_DBG_Commands_Monitor_EraseMemory *)msg->m_payload;
1041+
CLR_DBG_Commands_Monitor_EraseMemory_Reply cmdReply;
1042+
uint32_t errorCode;
10321043

1044+
// command reply is to be loaded with the error code and sent back to the caller
10331045
g_CLR_DBG_Debugger->AccessMemory(cmd->address, cmd->length, NULL, AccessMemory_Erase, &errorCode);
10341046

1035-
WP_ReplyToCommand(msg, true, false, &errorCode, sizeof(errorCode));
1047+
// copy over the error code to the command reply
1048+
cmdReply = errorCode;
1049+
1050+
// the execution of this command is always successful, and the reply carries the error code
1051+
WP_ReplyToCommand(msg, true, false, &cmdReply, sizeof(cmdReply));
10361052

10371053
return true;
10381054
}

0 commit comments

Comments
 (0)