Skip to content

Commit

Permalink
Add debugger minimal for RTM (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Feb 12, 2018
1 parent 4bab575 commit 168b452
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMake/Modules/FindNF_Debugger.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
set(NF_Debugger_SRCS

Debugger.cpp
Debugger_full.cpp

Messaging.cpp

Expand All @@ -25,6 +24,14 @@ set(NF_Debugger_SRCS
nanoSupport_CRC32.c
)

# add the debugger source file according to the build flavor
if(NF_BUILD_RTM)
set(NF_Debugger_SRCS ${NF_Debugger_SRCS} Debugger_minimal.cpp)
else()
set(NF_Debugger_SRCS ${NF_Debugger_SRCS} Debugger_full.cpp)
endif()


foreach(SRC_FILE ${NF_Debugger_SRCS})
set(NF_Debugger_SRC_FILE SRC_FILE-NOTFOUND)
find_file(NF_Debugger_SRC_FILE ${SRC_FILE}
Expand Down
46 changes: 46 additions & 0 deletions src/CLR/Debugger/Debugger_minimal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// Copyright (c) 2018 The nanoFramework project contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//

#include <nanoCLR_Runtime.h>
#include <nanoCLR_Debugging.h>

#define DEFINE_CMD(cmd) { CLR_DBG_Debugger::Debugging_##cmd, CLR_DBG_Commands::c_Debugging_##cmd }
#define DEFINE_CMD2(cmd) { CLR_DBG_Debugger::Monitor_##cmd , CLR_DBG_Commands::c_Monitor_##cmd }

const CLR_Messaging_CommandHandlerLookup c_Debugger_Lookup_Request[] =
{
DEFINE_CMD2(Ping ),
DEFINE_CMD2(Reboot ),
DEFINE_CMD(Execution_QueryCLRCapabilities),

DEFINE_CMD2(ReadMemory ),
DEFINE_CMD2(WriteMemory),
DEFINE_CMD2(EraseMemory),
//
DEFINE_CMD2(Execute ),
DEFINE_CMD2(MemoryMap ),
DEFINE_CMD2(FlashSectorMap),

DEFINE_CMD(UpgradeToSsl),







};

const CLR_Messaging_CommandHandlerLookup c_Debugger_Lookup_Reply[] =
{
DEFINE_CMD2(Ping),
};

#undef DEFINE_CMD
#undef DEFINE_CMD2

const CLR_UINT32 c_Debugger_Lookup_Request_count = ARRAYSIZE(c_Debugger_Lookup_Request);
const CLR_UINT32 c_Debugger_Lookup_Reply_count = ARRAYSIZE(c_Debugger_Lookup_Reply);

0 comments on commit 168b452

Please sign in to comment.