summaryrefslogtreecommitdiff
path: root/src/debug/ee
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/ee')
-rw-r--r--src/debug/ee/DIRS.proj20
-rw-r--r--src/debug/ee/DebuggerEE.vcproj107
-rw-r--r--src/debug/ee/EE.props60
-rw-r--r--src/debug/ee/amd64/amd64walker.cpp5
-rw-r--r--src/debug/ee/arm64/dbghelpers.S25
-rw-r--r--src/debug/ee/dac/dirs.proj19
-rw-r--r--src/debug/ee/debugger.cpp13
-rw-r--r--src/debug/ee/debugger.inl16
-rw-r--r--src/debug/ee/i386/x86walker.cpp16
-rw-r--r--src/debug/ee/wks/CMakeLists.txt2
-rw-r--r--src/debug/ee/wks/wks.nativeproj43
11 files changed, 55 insertions, 271 deletions
diff --git a/src/debug/ee/DIRS.proj b/src/debug/ee/DIRS.proj
deleted file mode 100644
index 63dd0c8..0000000
--- a/src/debug/ee/DIRS.proj
+++ /dev/null
@@ -1,20 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--Import the settings-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />
-
- <!--The following projects will build during PHASE 1-->
- <PropertyGroup>
- <BuildInPhase1>true</BuildInPhase1>
- <BuildInPhaseDefault>false</BuildInPhaseDefault>
- <BuildCoreBinaries>true</BuildCoreBinaries>
- <BuildSysBinaries>true</BuildSysBinaries>
- </PropertyGroup>
-
- <ItemGroup Condition="'$(BuildExePhase)' == '1'">
- <ProjectFile Include="wks\wks.nativeproj" />
- <ProjectFile Include="dac\dirs.proj" />
- </ItemGroup>
-
- <!--Import the targets-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\tools\Microsoft.DevDiv.Traversal.targets" />
-</Project>
diff --git a/src/debug/ee/DebuggerEE.vcproj b/src/debug/ee/DebuggerEE.vcproj
deleted file mode 100644
index 6df51a0..0000000
--- a/src/debug/ee/DebuggerEE.vcproj
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="DebuggerEE"
- ProjectGUID="{31EEC9FD-A233-4B36-8762-2D30A030C319}"
- Keyword="MakeFileProj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="0">
- <Tool
- Name="VCNMakeTool"
- Output="DebuggerEE.exe"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="0">
- <Tool
- Name="VCNMakeTool"
- Output="DebuggerEE.exe"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
- <File
- RelativePath="controller.cpp">
- </File>
- <File
- RelativePath="debugger.cpp">
- </File>
- <File
- RelativePath="frameinfo.cpp">
- </File>
- <File
- RelativePath="ilwalker.cpp">
- </File>
- <File
- RelativePath="lscommon.cpp">
- </File>
- <File
- RelativePath="lsdivalue.cpp">
- </File>
- <File
- RelativePath="lshash.cpp">
- </File>
- <File
- RelativePath="lsmodule.cpp">
- </File>
- <File
- RelativePath="lsprocess.cpp">
- </File>
- <File
- RelativePath="lsthread.cpp">
- </File>
- <File
- RelativePath="rcthread.cpp">
- </File>
- <File
- RelativePath="stdafx.cpp">
- </File>
- <File
- RelativePath="thread.cpp">
- </File>
- <File
- RelativePath="i386\x86walker.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc">
- <File
- RelativePath="controller.h">
- </File>
- <File
- RelativePath="debugger.h">
- </File>
- <File
- RelativePath="frameinfo.h">
- </File>
- <File
- RelativePath="stdafx.h">
- </File>
- <File
- RelativePath="walker.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/debug/ee/EE.props b/src/debug/ee/EE.props
deleted file mode 100644
index 90b9f81..0000000
--- a/src/debug/ee/EE.props
+++ /dev/null
@@ -1,60 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--*****************************************************-->
- <!--This MSBuild project file was automatically generated-->
- <!--from the original SOURCES/DIRS file by the KBC tool.-->
- <!--*****************************************************-->
- <!--Import the settings-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />
- <Import Project="$(Clrbase)\src\Debug\SetDebugTargetLocal.props" />
- <!--Leaf project Properties-->
- <PropertyGroup>
- <UserIncludes>$(UserIncludes);
- $(Clrbase)\src\Debug\EE;
- $(Clrbase)\src\vm;
- $(Clrbase)\src\vm\$(TargetCpu);
- $(Clrbase)\src\Debug\inc;
- $(Clrbase)\src\Debug\inc\$(TargetCpu);
- $(Clrbase)\src\Debug\inc\dump;
- $(VCToolsIncPath);
- $(Clrbase)\src\strongname\inc</UserIncludes>
- <ClAdditionalOptions>$(ClAdditionalOptions) -DUNICODE -D_UNICODE -DFEATURE_NO_HOST</ClAdditionalOptions>
- <PCHHeader Condition="'$(CCOVER)' == ''">stdafx.h</PCHHeader>
- <EnableCxxPCHHeaders Condition="'$(CCOVER)' == ''">true</EnableCxxPCHHeaders>
- <!--PCH: Both precompiled header and cpp are on the same ..\ path this is likely to be wrong.-->
- <PCHCompile Condition="'$(CCOVER)' == ''">$(Clrbase)\src\Debug\EE\stdafx.cpp</PCHCompile>
- </PropertyGroup>
- <!--Leaf Project Items-->
- <ItemGroup>
- <CppCompile Include="$(Clrbase)\src\Debug\EE\controller.cpp" />
- <CppCompile Include="$(Clrbase)\src\Debug\EE\Debugger.cpp" />
- <CppCompile Include="$(Clrbase)\src\Debug\EE\DebuggerModule.cpp" />
- <CppCompile Include="$(Clrbase)\src\Debug\EE\functioninfo.cpp" />
- </ItemGroup>
- <ItemGroup>
- <SourcesNodac Include="$(Clrbase)\src\Debug\EE\funceval.cpp" />
- <SourcesNodac Include="$(Clrbase)\src\Debug\EE\RCThread.cpp" />
- <SourcesNodac Include="$(Clrbase)\src\Debug\EE\Canary.cpp" />
- <SourcesNodac Include="$(Clrbase)\src\Debug\EE\shared.cpp" />
- <SourcesNodac Include="$(Clrbase)\src\Debug\EE\frameinfo.cpp" />
- </ItemGroup>
- <ItemGroup>
- <I386Sources Condition="'$(TargetArch)' == 'i386'" Include="$(Clrbase)\src\Debug\EE\i386\x86walker.cpp" />
- <I386Sources Condition="'$(TargetArch)' == 'i386'" Include="$(Clrbase)\src\Debug\EE\i386\primitives.cpp" />
- <I386Sources Condition="'$(TargetArch)' == 'i386'" Include="$(Clrbase)\src\Debug\EE\i386\DebuggerRegDisplayHelper.cpp" />
- </ItemGroup>
- <ItemGroup>
- <Amd64Sources Condition="'$(TargetArch)' == 'amd64'" Include="$(Clrbase)\src\Debug\EE\amd64\primitives.cpp" />
- <Amd64Sources Condition="'$(TargetArch)' == 'amd64'" Include="$(Clrbase)\src\Debug\EE\amd64\Amd64walker.cpp" />
- <Amd64Sources Condition="'$(TargetArch)' == 'amd64'" Include="$(Clrbase)\src\Debug\EE\amd64\DebuggerRegDisplayHelper.cpp" />
- </ItemGroup>
- <ItemGroup>
- <ArmSources Condition="'$(TargetArch)' == 'arm'" Include="$(Clrbase)\src\Debug\EE.\arm\primitives.cpp" />
- <ArmSources Condition="'$(TargetArch)' == 'arm'" Include="$(Clrbase)\src\Debug\EE\arm\ArmWalker.cpp" />
- </ItemGroup>
- <ItemGroup>
- <Arm64Sources Condition="'$(TargetArch)' == 'arm64'" Include="$(Clrbase)\src\Debug\EE\arm64\primitives.cpp" />
- <Arm64Sources Condition="'$(TargetArch)' == 'arm64'" Include="$(Clrbase)\src\Debug\EE\arm64\Arm64Walker.cpp" />
- </ItemGroup>
-
- <!--Import the targets-->
-</Project>
diff --git a/src/debug/ee/amd64/amd64walker.cpp b/src/debug/ee/amd64/amd64walker.cpp
index 836d214..39e9784 100644
--- a/src/debug/ee/amd64/amd64walker.cpp
+++ b/src/debug/ee/amd64/amd64walker.cpp
@@ -131,10 +131,11 @@ void NativeWalker::Decode()
{
case 0xff:
{
-
BYTE modrm = *ip++;
- _ASSERT(modrm != NULL);
+ // Ignore "inc dword ptr [reg]" instructions
+ if (modrm == 0)
+ break;
BYTE mod = (modrm & 0xC0) >> 6;
BYTE reg = (modrm & 0x38) >> 3;
diff --git a/src/debug/ee/arm64/dbghelpers.S b/src/debug/ee/arm64/dbghelpers.S
new file mode 100644
index 0000000..07ed04a
--- /dev/null
+++ b/src/debug/ee/arm64/dbghelpers.S
@@ -0,0 +1,25 @@
+//Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "unixasmmacros.inc"
+
+NESTED_ENTRY FuncEvalHijack, _TEXT, FuncEvalHijackPersonalityRoutine
+
+// NOTE: FuncEvalHijackPersonalityRoutine is dependent on the stack layout so if
+// you change the prolog you will also need to update the personality routine.
+
+// push arg to the stack so our personality routine can find it
+// push lr to get good stacktrace in debugger
+
+PROLOG_SAVE_REG_PAIR fp, lr, #-32
+
+ str x0, [sp, #16]
+ // FuncEvalHijackWorker returns the address we should jump to.
+ bl FuncEvalHijackWorker
+
+ EPILOG_STACK_FREE 32
+ EPILOG_BRANCH_REG x0
+NESTED_END FuncEvalHijack, _TEXT
+
+//NESTED_ENTRY ExceptionHijack,,ExceptionHijackPersonalityRoutine \ No newline at end of file
diff --git a/src/debug/ee/dac/dirs.proj b/src/debug/ee/dac/dirs.proj
deleted file mode 100644
index 8b76656..0000000
--- a/src/debug/ee/dac/dirs.proj
+++ /dev/null
@@ -1,19 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--Import the settings-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />
-
- <!--The following projects will build during PHASE 1-->
- <PropertyGroup>
- <BuildInPhase1>true</BuildInPhase1>
- <BuildInPhaseDefault>false</BuildInPhaseDefault>
- <BuildCoreBinaries>true</BuildCoreBinaries>
- <BuildSysBinaries>true</BuildSysBinaries>
- </PropertyGroup>
-
- <ItemGroup Condition="'$(BuildExePhase)' == '1'">
- <ProjectFile Include="HostLocal\dacwks.nativeproj" />
- </ItemGroup>
-
- <!--Import the targets-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\tools\Microsoft.DevDiv.Traversal.targets" />
-</Project>
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index 2aed8bd..1f2126b 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -1898,7 +1898,7 @@ void Debugger::SendCreateProcess(DebuggerLockHolder * pDbgLockHolder)
#if defined(FEATURE_CORECLR) && !defined(FEATURE_PAL)
-HANDLE g_hContinueStartupEvent = NULL;
+HANDLE g_hContinueStartupEvent = INVALID_HANDLE_VALUE;
CLR_ENGINE_METRICS g_CLREngineMetrics = {
sizeof(CLR_ENGINE_METRICS),
@@ -1945,7 +1945,7 @@ void NotifyDebuggerOfTelestoStartup()
// enumeration of this process will get back a valid continue event
// the instant we signal the startup notification event.
- CONSISTENCY_CHECK(NULL == g_hContinueStartupEvent);
+ CONSISTENCY_CHECK(INVALID_HANDLE_VALUE == g_hContinueStartupEvent);
g_hContinueStartupEvent = WszCreateEvent(NULL, TRUE, FALSE, NULL);
CONSISTENCY_CHECK(INVALID_HANDLE_VALUE != g_hContinueStartupEvent); // we reserve this value for error conditions in EnumerateCLRs
@@ -2173,7 +2173,14 @@ HRESULT Debugger::Startup(void)
// Signal the debugger (via dbgshim) and wait until it is ready for us to
// continue. This needs to be outside the lock and after the transport is
// initialized.
- PAL_NotifyRuntimeStarted();
+ if (PAL_NotifyRuntimeStarted())
+ {
+ // The runtime was successfully launched and attached so mark it now
+ // so no notifications are missed especially the initial module load
+ // which would cause debuggers problems with reliable setting breakpoints
+ // in startup code or Main.
+ MarkDebuggerAttachedInternal();
+ }
#endif // FEATURE_PAL
// We don't bother changing this process's permission.
diff --git a/src/debug/ee/debugger.inl b/src/debug/ee/debugger.inl
index dbd5479..5737286 100644
--- a/src/debug/ee/debugger.inl
+++ b/src/debug/ee/debugger.inl
@@ -235,14 +235,14 @@ inline void FuncEvalFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
// Update all registers in the reg display from the CONTEXT we stored when the thread was hijacked for this func
// eval. We have to update all registers, not just the callee saved registers, because we can hijack a thread at any
// point for a func eval, not just at a call site.
- pRD->pEdi = &(pDE->m_context.Edi);
- pRD->pEsi = &(pDE->m_context.Esi);
- pRD->pEbx = &(pDE->m_context.Ebx);
- pRD->pEdx = &(pDE->m_context.Edx);
- pRD->pEcx = &(pDE->m_context.Ecx);
- pRD->pEax = &(pDE->m_context.Eax);
- pRD->pEbp = &(pDE->m_context.Ebp);
- pRD->Esp = (DWORD)GetSP(&pDE->m_context);
+ pRD->SetEdiLocation(&(pDE->m_context.Edi));
+ pRD->SetEsiLocation(&(pDE->m_context.Esi));
+ pRD->SetEbxLocation(&(pDE->m_context.Ebx));
+ pRD->SetEdxLocation(&(pDE->m_context.Edx));
+ pRD->SetEcxLocation(&(pDE->m_context.Ecx));
+ pRD->SetEaxLocation(&(pDE->m_context.Eax));
+ pRD->SetEbpLocation(&(pDE->m_context.Ebp));
+ pRD->SP = (DWORD)GetSP(&pDE->m_context);
pRD->PCTAddr = GetReturnAddressPtr();
pRD->ControlPC = *PTR_PCODE(pRD->PCTAddr);
diff --git a/src/debug/ee/i386/x86walker.cpp b/src/debug/ee/i386/x86walker.cpp
index dd03468..8b62797 100644
--- a/src/debug/ee/i386/x86walker.cpp
+++ b/src/debug/ee/i386/x86walker.cpp
@@ -292,28 +292,28 @@ DWORD NativeWalker::GetRegisterValue(int registerNumber)
switch (registerNumber)
{
case 0:
- return *m_registers->pEax;
+ return *m_registers->GetEaxLocation();
break;
case 1:
- return *m_registers->pEcx;
+ return *m_registers->GetEcxLocation();
break;
case 2:
- return *m_registers->pEdx;
+ return *m_registers->GetEdxLocation();
break;
case 3:
- return *m_registers->pEbx;
+ return *m_registers->GetEbxLocation();
break;
case 4:
- return m_registers->Esp;
+ return m_registers->SP;
break;
case 5:
- return *m_registers->pEbp;
+ return *m_registers->GetEbpLocation();
break;
case 6:
- return *m_registers->pEsi;
+ return *m_registers->GetEsiLocation();
break;
case 7:
- return *m_registers->pEdi;
+ return *m_registers->GetEdiLocation();
break;
default:
_ASSERTE(!"Invalid register number!");
diff --git a/src/debug/ee/wks/CMakeLists.txt b/src/debug/ee/wks/CMakeLists.txt
index 2b1aff5..1088355 100644
--- a/src/debug/ee/wks/CMakeLists.txt
+++ b/src/debug/ee/wks/CMakeLists.txt
@@ -55,7 +55,7 @@ else ()
add_compile_options(-fPIC)
-if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_I386)
+if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64 OR CLR_CMAKE_PLATFORM_ARCH_I386)
add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ../${ARCH_SOURCES_DIR}/dbghelpers.S)
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS})
diff --git a/src/debug/ee/wks/wks.nativeproj b/src/debug/ee/wks/wks.nativeproj
deleted file mode 100644
index 304c591..0000000
--- a/src/debug/ee/wks/wks.nativeproj
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="dogfood">
- <!--*****************************************************-->
- <!--This MSBuild project file was automatically generated-->
- <!--from the original SOURCES/DIRS file by the KBC tool.-->
- <!--*****************************************************-->
- <!--Import the settings-->
- <!--Leaf project Properties-->
- <PropertyGroup Label="Globals">
- <SccProjectName>SAK</SccProjectName>
- <SccAuxPath>SAK</SccAuxPath>
- <SccLocalPath>SAK</SccLocalPath>
- <SccProvider>SAK</SccProvider>
- </PropertyGroup>
- <PropertyGroup>
- <BuildCoreBinaries>true</BuildCoreBinaries>
- <BuildSysBinaries>true</BuildSysBinaries>
- <OutputPath>$(ClrLibDest)</OutputPath>
- <OutputName>cordbee_wks</OutputName>
- <TargetType>LIBRARY</TargetType>
- <UserAssembleAmd64IncludePath>
- $(UserAssembleAmd64IncludePath);
- ..\..\..\vm\AMD64;
- </UserAssembleAmd64IncludePath>
- </PropertyGroup>
- <!--Leaf Project Items-->
- <Import Project="..\EE.props" />
- <ItemGroup>
- <CppCompile Include="@(SourcesNodac)" />
- <CppCompile Include="@(I386Sources)" />
- <CppCompile Include="@(Amd64Sources)" />
- <CppCompile Include="@(ArmSources)" />
- <CppCompile Include="@(Arm64Sources)" />
- <PreprocessAssembleArm Condition="'$(BuildArchitecture)' == 'arm'" Include="..\arm\dbghelpers.asm" />
- <PreprocessAssembleArm Condition="'$(BuildArchitecture)' == 'arm64'" Include="..\arm64\dbghelpers.asm" />
- <AssembleArm Condition="'$(BuildArchitecture)' == 'arm'" Include="$(IntermediateOutputDirectory)\dbghelpers.i" />
- <AssembleArm64 Condition="'$(BuildArchitecture)' == 'arm64'" Include="$(IntermediateOutputDirectory)\dbghelpers.i" />
- <Assemble386 Condition="'$(BuildArchitecture)' == 'i386'" Include="..\i386\dbghelpers.asm" />
- <AssembleAmd64 Condition="'$(BuildArchitecture)' == 'amd64'" Include="..\amd64\dbghelpers.asm" />
- </ItemGroup>
- <!--Import the targets-->
- <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.targets" />
-</Project>