diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-01-31 21:15:43 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-01-31 23:12:21 +0300 |
commit | 17b9404d3a33ff34cc204998b62e944c879d3dd1 (patch) | |
tree | 72d2d653d10cb171447c81beef82fa0c7528e939 /main/src/addins/MonoDevelop.Debugger.Win32 | |
parent | a80a642a5e3a3f925fe6f852d6f2844023e50c8b (diff) | |
parent | 26ad42f934f962a4c11f02e129e0461be2e96ed9 (diff) |
Merge remote-tracking branch 'origin/vNext' into roslyn-ivt
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.Win32')
8 files changed, 131 insertions, 33 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi/CorApi.csproj b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi/CorApi.csproj index 2caff90533..d4f4e6e160 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi/CorApi.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi/CorApi.csproj @@ -64,5 +64,6 @@ <Compile Include="RawAssemblyAttributes.cs" /> <Compile Include="WindowsImports.cs" /> </ItemGroup> + <Import Project="..\..\..\..\external\debugger-libs\Mono.Debugging.settings" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project> diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/CorApi2.csproj b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/CorApi2.csproj index 1b39e0e24e..184f092098 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/CorApi2.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/CorApi2.csproj @@ -131,6 +131,7 @@ <Compile Include="Extensions\ProcessExtensions.cs" /> <Compile Include="Extensions\DebuggerExtensions.cs" /> </ItemGroup> + <Import Project="..\..\..\..\\external\debugger-libs\Mono.Debugging.settings" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32.sln b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32.sln new file mode 100644 index 0000000000..9bfe1ee53e --- /dev/null +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32.sln @@ -0,0 +1,40 @@ +
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Debugging.Win32", "Mono.Debugging.Win32\Mono.Debugging.Win32.csproj", "{74704C00-5861-4F86-920C-865148A175C5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorApi2", "CorApi2\CorApi2.csproj", "{69136056-BFD3-4CEC-BB41-D9991C79593C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorApi", "CorApi\CorApi.csproj", "{9FBCC262-10DC-4E84-A5C4-17230BBF8862}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Debugging", "..\..\..\external\debugger-libs\Mono.Debugging\Mono.Debugging.csproj", "{90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {74704C00-5861-4F86-920C-865148A175C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {74704C00-5861-4F86-920C-865148A175C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {74704C00-5861-4F86-920C-865148A175C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {74704C00-5861-4F86-920C-865148A175C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {69136056-BFD3-4CEC-BB41-D9991C79593C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {69136056-BFD3-4CEC-BB41-D9991C79593C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69136056-BFD3-4CEC-BB41-D9991C79593C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {69136056-BFD3-4CEC-BB41-D9991C79593C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9FBCC262-10DC-4E84-A5C4-17230BBF8862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9FBCC262-10DC-4E84-A5C4-17230BBF8862}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9FBCC262-10DC-4E84-A5C4-17230BBF8862}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9FBCC262-10DC-4E84-A5C4-17230BBF8862}.Release|Any CPU.Build.0 = Release|Any CPU
+ {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerBacktrace.cs b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerBacktrace.cs index 5de0135b49..ea3d64e164 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerBacktrace.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerBacktrace.cs @@ -7,6 +7,7 @@ using Microsoft.Samples.Debugging.CorMetadata; using Mono.Debugging.Client;
using Mono.Debugging.Evaluation;
using System.Linq;
+using System.Runtime.InteropServices;
namespace Mono.Debugging.Win32
{
@@ -29,12 +30,27 @@ namespace Mono.Debugging.Win32 internal static IEnumerable<CorFrame> GetFrames (CorThread thread)
{
- foreach (CorChain chain in thread.Chains) {
- if (!chain.IsManaged)
- continue;
- foreach (CorFrame frame in chain.Frames)
- yield return frame;
+ var corFrames = new List<CorFrame> ();
+ try {
+ foreach (CorChain chain in thread.Chains) {
+ if (!chain.IsManaged)
+ continue;
+ try {
+ var chainFrames = chain.Frames;
+
+ foreach (CorFrame frame in chainFrames)
+ corFrames.Add (frame);
+ }
+ catch (COMException e) {
+ DebuggerLoggingService.LogMessage ("Failed to enumerate frames of chain: {0}", e.Message);
+ }
+ }
+
+ }
+ catch (COMException e) {
+ DebuggerLoggingService.LogMessage ("Failed to enumerate chains of thread: {0}", e.Message);
}
+ return corFrames;
}
internal List<CorFrame> FrameList {
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs index e8f7ec0b68..acf6bbafa8 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs @@ -888,13 +888,15 @@ namespace Mono.Debugging.Win32 {
MtaThread.Run (delegate
{
- CorBreakpoint bp = binfo.Handle as CorFunctionBreakpoint;
- if (bp != null) {
- try {
- bp.Activate (enable);
- }
- catch (COMException e) {
- HandleBreakpointException (binfo, e);
+ var bpList = binfo.Handle as List<CorFunctionBreakpoint>;
+ if (bpList != null) {
+ foreach (var bp in bpList) {
+ try {
+ bp.Activate (enable);
+ }
+ catch (COMException e) {
+ HandleBreakpointException (binfo, e);
+ }
}
}
});
@@ -1040,16 +1042,21 @@ namespace Mono.Debugging.Win32 // FIXME: implement breaking on function name
binfo.SetStatus (BreakEventStatus.Invalid, "Function breakpoint is not implemented");
return binfo;
- } else {
- DocInfo doc = null;
+ }
+ else {
+ var docInfos = new List<DocInfo> ();
lock (appDomainsLock) {
foreach (var appDomainInfo in appDomains) {
var documents = appDomainInfo.Value.Documents;
- if (documents.TryGetValue (Path.GetFullPath (bp.FileName), out doc)) {
- break;
+ DocInfo docInfo = null;
+ if (documents.TryGetValue (Path.GetFullPath (bp.FileName), out docInfo)) {
+ docInfos.Add (docInfo);
}
}
}
+
+ var doc = docInfos.FirstOrDefault (); //get info about source position using SymbolReader of first DocInfo
+
if (doc == null) {
binfo.SetStatus (BreakEventStatus.NotBound, string.Format("{0} is not found among the loaded symbol documents", bp.FileName));
return binfo;
@@ -1145,16 +1152,22 @@ namespace Mono.Debugging.Win32 return binfo;
}
- CorFunction func = doc.ModuleInfo.Module.GetFunctionFromToken (bestMethod.Token.GetToken ());
- try {
- CorFunctionBreakpoint corBp = func.ILCode.CreateBreakpoint (bestSp.Offset);
- breakpoints[corBp] = binfo;
- binfo.Handle = corBp;
- corBp.Activate (bp.Enabled);
- binfo.SetStatus (BreakEventStatus.Bound, null);
- }
- catch (COMException e) {
- HandleBreakpointException (binfo, e);
+ foreach (var docInfo in docInfos) {
+ CorFunction func = docInfo.ModuleInfo.Module.GetFunctionFromToken (bestMethod.Token.GetToken ());
+
+ try {
+ CorFunctionBreakpoint corBp = func.ILCode.CreateBreakpoint (bestSp.Offset);
+ breakpoints[corBp] = binfo;
+
+ if (binfo.Handle == null)
+ binfo.Handle = new List<CorFunctionBreakpoint> ();
+ (binfo.Handle as List<CorFunctionBreakpoint>).Add (corBp);
+ corBp.Activate (bp.Enabled);
+ binfo.SetStatus (BreakEventStatus.Bound, null);
+ }
+ catch (COMException e) {
+ HandleBreakpointException (binfo, e);
+ }
}
return binfo;
}
@@ -1298,12 +1311,14 @@ namespace Mono.Debugging.Win32 MtaThread.Run (delegate
{
- CorFunctionBreakpoint corBp = (CorFunctionBreakpoint)bi.Handle;
- try {
- corBp.Activate (false);
- }
- catch (COMException e) {
- HandleBreakpointException (bi, e);
+ var corBpList = (List<CorFunctionBreakpoint>)bi.Handle;
+ foreach (var corBp in corBpList) {
+ try {
+ corBp.Activate (false);
+ }
+ catch (COMException e) {
+ HandleBreakpointException (bi, e);
+ }
}
});
}
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorObjectAdaptor.cs b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorObjectAdaptor.cs index fc7694427f..f43c6d913d 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorObjectAdaptor.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorObjectAdaptor.cs @@ -154,7 +154,7 @@ namespace Mono.Debugging.Win32 }
catch (Exception ex) {
DebuggerLoggingService.LogError ("Exception in GetTypeName()", ex);
- return t.FullName;
+ return "[Unknown type]";
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.csproj b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.csproj index 1c43f87bca..7565b34341 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.csproj @@ -91,6 +91,7 @@ <Name>CorApi</Name> </ProjectReference> </ItemGroup> + <Import Project="..\..\..\..\\external\debugger-libs\Mono.Debugging.settings" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.nuspec b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.nuspec new file mode 100644 index 0000000000..53cf655d2d --- /dev/null +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/Mono.Debugging.Win32.nuspec @@ -0,0 +1,24 @@ +<?xml version="1.0"?>
+<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <id>Mono.Debugging.Win32</id>
+ <version>$buildver$</version>
+ <title>Mono.Debugging.Win32</title>
+ <authors>MonoDevelop team</authors>
+ <owners>MonoDevelop team</owners>
+ <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <projectUrl>https://github.com/mono/monodevelop</projectUrl>
+ <summary>Debugger implementation for CorDebug</summary>
+ <description>Debugger implementation for CorDebug</description>
+ <language>en-US</language>
+ <tags>mono debug debugger cordebug</tags>
+ <dependencies>
+ <dependency id="Mono.Debugging" version="$buildver$" />
+ </dependencies>
+ </metadata>
+ <files>
+ <file src="bin\$Configuration$\CorApi.dll" target="lib/net45" />
+ <file src="bin\$Configuration$\CorApi2.dll" target="lib/net45" />
+ </files>
+</package>
|