diff options
Diffstat (limited to 'src/ToolBox/SOS')
-rw-r--r-- | src/ToolBox/SOS/Strike/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/datatarget.cpp | 7 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/disasm.h | 7 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/disasmARM.cpp | 16 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/util.cpp | 2 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/inc/lldbservices.h | 1 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/services.cpp | 4 |
7 files changed, 30 insertions, 8 deletions
diff --git a/src/ToolBox/SOS/Strike/CMakeLists.txt b/src/ToolBox/SOS/Strike/CMakeLists.txt index 124fe979b3..11c75843d9 100644 --- a/src/ToolBox/SOS/Strike/CMakeLists.txt +++ b/src/ToolBox/SOS/Strike/CMakeLists.txt @@ -28,6 +28,7 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_I386) elseif(CLR_CMAKE_PLATFORM_ARCH_ARM) add_definitions(-DSOS_TARGET_ARM=1) add_definitions(-D_TARGET_WIN32_=1) + add_definitions(-D_TARGET_ARM_=1) add_definitions(-DDBG_TARGET_32BIT) elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64) add_definitions(-DSOS_TARGET_ARM64=1) diff --git a/src/ToolBox/SOS/Strike/datatarget.cpp b/src/ToolBox/SOS/Strike/datatarget.cpp index 869ae674ab..0e981dd537 100644 --- a/src/ToolBox/SOS/Strike/datatarget.cpp +++ b/src/ToolBox/SOS/Strike/datatarget.cpp @@ -81,7 +81,14 @@ HRESULT STDMETHODCALLTYPE DataTarget::GetPointerSize( /* [out] */ ULONG32 *size) { +#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) *size = 8; +#elif defined(SOS_TARGET_ARM) + *size = 4; +#elif + #error Unsupported architecture +#endif + return S_OK; } diff --git a/src/ToolBox/SOS/Strike/disasm.h b/src/ToolBox/SOS/Strike/disasm.h index d3c13fee3f..6972c39ccb 100644 --- a/src/ToolBox/SOS/Strike/disasm.h +++ b/src/ToolBox/SOS/Strike/disasm.h @@ -108,9 +108,9 @@ eTargetType GetFinalTarget(DWORD_PTR callee, DWORD_PTR* finalMDorIP); //----------------------------------------------------------------------------------------- #ifndef THUMB_CODE -#define THUMB_CODE 1; +#define THUMB_CODE 1 #endif -#define STACKWALK_CONTROLPC_ADJUST_OFFSET 2; +#define STACKWALK_CONTROLPC_ADJUST_OFFSET 2 #ifdef SOS_TARGET_X86 @@ -186,7 +186,7 @@ public: typedef ARM_CONTEXT TGT_CTXT; static IMachine* GetInstance() - { static ARMMachine s_ARMMachineInstance; return &s_ARMMachineInstance; } + { return &s_ARMMachineInstance; } ULONG GetPlatform() const { return IMAGE_FILE_MACHINE_ARMNT; } ULONG GetContextSize() const { return sizeof(ARM_CONTEXT); } @@ -238,6 +238,7 @@ private: static LPCSTR s_DSOHeading; static LPCSTR s_GCRegs[14]; static LPCSTR s_SPName; + static ARMMachine s_ARMMachineInstance; }; // class ARMMachine #endif // SOS_TARGET_ARM diff --git a/src/ToolBox/SOS/Strike/disasmARM.cpp b/src/ToolBox/SOS/Strike/disasmARM.cpp index acdd633d4a..80dce71890 100644 --- a/src/ToolBox/SOS/Strike/disasmARM.cpp +++ b/src/ToolBox/SOS/Strike/disasmARM.cpp @@ -48,6 +48,8 @@ namespace ARMGCDump #error This file should be used to support SOS targeting ARM debuggees #endif +#ifdef SOS_TARGET_ARM +ARMMachine ARMMachine::s_ARMMachineInstance; // Decodes the target label of the immediate form of bl and blx instructions. The PC given is that of the // start of the instruction. @@ -334,6 +336,8 @@ static void HandleValue(TADDR value) } } +#endif // !FEATURE_PAL + /**********************************************************************\ * Routine Description: * * * @@ -351,6 +355,7 @@ void ARMMachine::Unassembly ( BOOL bSuppressLines, BOOL bDisplayOffsets) const { +#ifndef FEATURE_PAL ULONG_PTR PC = PCBegin; char line[1024]; char *ptr; @@ -524,11 +529,12 @@ void ARMMachine::Unassembly ( ExtOut ("\n"); } +#endif // !FEATURE_PAL } +#if 0 // @ARMTODO: Figure out how to extract this information under CoreARM static void ExpFuncStateInit (TADDR *PCRetAddr) { -#if 0 // @ARMTODO: Figure out how to extract this information under CoreARM ULONG64 offset; if (FAILED(g_ExtSymbols->GetOffsetByName("ntdll!KiUserExceptionDispatcher", &offset))) { return; @@ -541,10 +547,9 @@ static void ExpFuncStateInit (TADDR *PCRetAddr) PCRetAddr[i++] = (TADDR)offset; } } -#endif // 0 } +#endif // 0 -#endif // !FEATURE_PAL // @ARMTODO: Figure out how to extract this information under CoreARM BOOL ARMMachine::GetExceptionContext (TADDR stack, TADDR PC, TADDR *cxrAddr, CROSS_PLATFORM_CONTEXT * cxr, @@ -598,13 +603,13 @@ BOOL ARMMachine::GetExceptionContext (TADDR stack, TADDR PC, TADDR *cxrAddr, CRO #endif // 0 } -#ifndef FEATURE_PAL /// /// Dump ARM GCInfo table /// void ARMMachine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPrintf, bool encBytes, bool bPrintHeader) const { +#ifndef FEATURE_PAL if (bPrintHeader) { ExtOut("Pointer table:\n"); @@ -614,6 +619,7 @@ void ARMMachine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPrint gcDump.gcPrintf = gcPrintf; gcDump.DumpGCTable(pTable, methodSize, 0); +#endif // !FEATURE_PAL } -#endif // !FEATURE_PAL +#endif // SOS_TARGET_ARM diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index 6f115b0c0a..b77c1d26ad 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -4548,6 +4548,8 @@ public: *pPlatform = CORDB_PLATFORM_POSIX_X86; else if(platformKind == IMAGE_FILE_MACHINE_AMD64) *pPlatform = CORDB_PLATFORM_POSIX_AMD64; + else if(platformKind == IMAGE_FILE_MACHINE_ARMNT) + *pPlatform = CORDB_PLATFORM_POSIX_ARM; else return E_FAIL; #else diff --git a/src/ToolBox/SOS/lldbplugin/inc/lldbservices.h b/src/ToolBox/SOS/lldbplugin/inc/lldbservices.h index 925b6c4327..6c713141f3 100644 --- a/src/ToolBox/SOS/lldbplugin/inc/lldbservices.h +++ b/src/ToolBox/SOS/lldbplugin/inc/lldbservices.h @@ -68,6 +68,7 @@ extern "C" { #define DEBUG_CLASS_IMAGE_FILE 3 #define IMAGE_FILE_MACHINE_I386 0x014c // Intel 386. +#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian #define IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8) // Execution status codes used for waiting, diff --git a/src/ToolBox/SOS/lldbplugin/services.cpp b/src/ToolBox/SOS/lldbplugin/services.cpp index 21d1a2c13c..f6b42139c4 100644 --- a/src/ToolBox/SOS/lldbplugin/services.cpp +++ b/src/ToolBox/SOS/lldbplugin/services.cpp @@ -401,7 +401,11 @@ HRESULT LLDBServices::GetExecutingProcessorType( PULONG type) { +#ifdef DBG_TARGET_AMD64 *type = IMAGE_FILE_MACHINE_AMD64; +#elif DBG_TARGET_ARM + *type = IMAGE_FILE_MACHINE_ARMNT; +#endif return S_OK; } |