-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First task to create a nuget package and remove sources from mono/mono #288
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.21022</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{372E8E3E-29D5-4B4D-88A2-4711CD628C4E}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Mono.Debugger.Soft</RootNamespace> | ||
<AssemblyName>Mono.Debugger.Soft</AssemblyName> | ||
<SignAssembly>True</SignAssembly> | ||
<AssemblyOriginatorKeyFile>mono.snk</AssemblyOriginatorKeyFile> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
<DefineConstants>MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL</DefineConstants> | ||
<ConsolePause>False</ConsolePause> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>True</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>False</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>False</ConsolePause> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugSymbols>True</DebugSymbols> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>True</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>False</ConsolePause> | ||
<DefineConstants>MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL</DefineConstants> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<NuGetVersionCecil Condition="$(NuGetVersionCecil) == ''">0.10.0-beta5</NuGetVersionCecil> | ||
</PropertyGroup> | ||
<Import Project="..\Mono.Debugging.settings" /> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<ItemGroup> | ||
<Compile Include="Mono.Debugger.Soft\AbsentInformationException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AppDomainCreateEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AppDomainMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AppDomainUnloadEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ArrayMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AssemblyLoadEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AssemblyMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AssemblyUnloadEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\BreakpointEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\BreakpointEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\Connection.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\CustomAttributeDataMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\CustomAttributeNamedArgumentMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\CustomAttributeTypedArgumentMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\DataConverter.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\EnumMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\Event.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\EventQueueImpl.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\EventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\EventSet.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\EventType.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ExceptionEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ExceptionEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\FieldInfoMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\IInvokeAsyncResult.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ILExceptionHandler.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ILInstruction.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ILInterpreter.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\IMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\InterfaceMappingMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\InvalidStackFrameException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\InvocationException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\InvokeOptions.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ITargetProcess.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\LocalVariable.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\Location.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodBodyMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodEntryEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodEntryEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodExitEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodExitEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\MethodMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\Mirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ModuleMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ObjectCollectedException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ObjectMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ParameterInfoMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\PrimitiveValue.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\PropertyInfoMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\StackFrame.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\StepEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\StepEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\StringMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\StructMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\SuspendPolicy.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ThreadDeathEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ThreadMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\ThreadStartEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\TypeLoadEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\TypeLoadEventRequest.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\TypeMirror.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\UserBreakEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\UserLogEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\Value.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VirtualMachine.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VirtualMachineManager.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VMDeathEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VMDisconnectedException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VMDisconnectEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VMMismatchException.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\VMStartEvent.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\AssemblyLoadEventRequest.cs" /> | ||
<Compile Include="Locale.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\PointerValue.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\LocalScope.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\DelayedLambdaValue.cs" /> | ||
<Compile Include="Mono.Debugger.Soft\DelayedLambdaType.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Makefile.am" /> | ||
<None Include="mono-git-revision" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<NuGetVersionCecil Condition="$(NuGetVersionCecil) == ''">0.10.1</NuGetVersionCecil> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Mono.Cecil" Version="$(NuGetVersionCecil)" PrivateAssets="all" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System" /> | ||
<PackageReference Include="Mono.Cecil" Version="$(NuGetVersionCecil)" /> | ||
<PackageReference Include="System.Runtime" Version="4.3.1" /> | ||
</ItemGroup> | ||
</Project> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
using System.IO; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Runtime.Remoting.Messaging; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Mono.Debugger.Soft | ||
{ | ||
|
@@ -69,12 +69,12 @@ public static VirtualMachine LaunchInternal (ITargetProcess p, ProcessStartInfo | |
return vm; | ||
} | ||
|
||
public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback callback) | ||
public static Task<VirtualMachine> BeginLaunch (ProcessStartInfo info, Action<Task<VirtualMachine>> callback) | ||
{ | ||
return BeginLaunch (info, callback, null); | ||
} | ||
|
||
public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback callback, LaunchOptions options) | ||
public static Task<VirtualMachine> BeginLaunch (ProcessStartInfo info, Action<Task<VirtualMachine>> callback, LaunchOptions options) | ||
{ | ||
if (info == null) | ||
throw new ArgumentNullException ("info"); | ||
|
@@ -111,20 +111,19 @@ public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback cal | |
socket.Close (); | ||
}; | ||
|
||
LaunchCallback c = new LaunchCallback (LaunchInternal); | ||
return c.BeginInvoke (p, info, socket, callback, socket); | ||
Task<VirtualMachine> t3 = Task<VirtualMachine>.Run (() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing a return LaunchInternal (p, info, socket)
.ContinueWith (antecendent => callback (antecendent)); |
||
return LaunchInternal (p, info, socket); | ||
}); | ||
t3.ContinueWith ((antecendent => callback (antecendent))); | ||
return t3; | ||
} | ||
|
||
public static VirtualMachine EndLaunch (IAsyncResult asyncResult) { | ||
public static VirtualMachine EndLaunch (Task<VirtualMachine> asyncResult) { | ||
if (asyncResult == null) | ||
throw new ArgumentNullException ("asyncResult"); | ||
|
||
if (!asyncResult.IsCompleted) | ||
asyncResult.AsyncWaitHandle.WaitOne (); | ||
|
||
AsyncResult result = (AsyncResult) asyncResult; | ||
LaunchCallback cb = (LaunchCallback) result.AsyncDelegate; | ||
return cb.EndInvoke (asyncResult); | ||
asyncResult.Wait (); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
One other remark is that we probably don't want to force a |
||
return asyncResult.Result; | ||
} | ||
|
||
public static VirtualMachine Launch (ProcessStartInfo info) | ||
|
@@ -193,17 +192,17 @@ public static VirtualMachine ListenInternal (Socket dbg_sock, Socket con_sock) { | |
return Connect (transport, console, null); | ||
} | ||
|
||
public static IAsyncResult BeginListen (IPEndPoint dbg_ep, AsyncCallback callback) { | ||
public static Task<VirtualMachine> BeginListen (IPEndPoint dbg_ep, Action<Task<VirtualMachine>> callback) { | ||
return BeginListen (dbg_ep, null, callback); | ||
} | ||
|
||
public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback) | ||
public static Task<VirtualMachine> BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, Action<Task<VirtualMachine>> callback) | ||
{ | ||
int dbg_port, con_port; | ||
return BeginListen (dbg_ep, con_ep, callback, out dbg_port, out con_port); | ||
} | ||
|
||
public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback, | ||
public static Task<VirtualMachine> BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, Action<Task<VirtualMachine>> callback, | ||
out int dbg_port, out int con_port) | ||
{ | ||
dbg_port = con_port = 0; | ||
|
@@ -222,21 +221,22 @@ public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, As | |
con_sock.Listen (1000); | ||
con_port = ((IPEndPoint) con_sock.LocalEndPoint).Port; | ||
} | ||
|
||
ListenCallback c = new ListenCallback (ListenInternal); | ||
return c.BeginInvoke (dbg_sock, con_sock, callback, con_sock ?? dbg_sock); | ||
|
||
Task<VirtualMachine> t = Task<VirtualMachine>.Run (() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above: return ListenInternal (dbg_sock, conn_sock)
.ContinueWith (antecendent => callback (antecendent)); |
||
return ListenInternal (dbg_sock, con_sock); | ||
}); | ||
t.ContinueWith ((antecendent => callback (antecendent))); | ||
return t; | ||
} | ||
|
||
public static VirtualMachine EndListen (IAsyncResult asyncResult) { | ||
public static VirtualMachine EndListen (Task<VirtualMachine> asyncResult) { | ||
if (asyncResult == null) | ||
throw new ArgumentNullException ("asyncResult"); | ||
|
||
if (!asyncResult.IsCompleted) | ||
asyncResult.AsyncWaitHandle.WaitOne (); | ||
asyncResult.Wait (); | ||
|
||
|
||
AsyncResult result = (AsyncResult) asyncResult; | ||
ListenCallback cb = (ListenCallback) result.AsyncDelegate; | ||
return cb.EndInvoke (asyncResult); | ||
return asyncResult.Result; | ||
} | ||
|
||
public static VirtualMachine Listen (IPEndPoint dbg_ep) | ||
|
@@ -292,11 +292,11 @@ public static VirtualMachine ConnectInternal (Socket dbg_sock, Socket con_sock, | |
return Connect (transport, console, null); | ||
} | ||
|
||
public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, AsyncCallback callback) { | ||
public static Task<VirtualMachine> BeginConnect (IPEndPoint dbg_ep, Action<Task<VirtualMachine>> callback) { | ||
return BeginConnect (dbg_ep, null, callback); | ||
} | ||
|
||
public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback) { | ||
public static Task<VirtualMachine> BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, Action<Task<VirtualMachine>> callback) { | ||
Socket dbg_sock = null; | ||
Socket con_sock = null; | ||
|
||
|
@@ -305,21 +305,20 @@ public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, A | |
if (con_ep != null) { | ||
con_sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); | ||
} | ||
|
||
ConnectCallback c = new ConnectCallback (ConnectInternal); | ||
return c.BeginInvoke (dbg_sock, con_sock, dbg_ep, con_ep, callback, con_sock ?? dbg_sock); | ||
|
||
Task<VirtualMachine> t3 = Task<VirtualMachine>.Run (() => { | ||
return ConnectInternal (dbg_sock, con_sock, dbg_ep, con_ep); | ||
}); | ||
t3.ContinueWith((antecendent => callback (antecendent))); | ||
return t3; | ||
} | ||
|
||
public static VirtualMachine EndConnect (IAsyncResult asyncResult) { | ||
public static VirtualMachine EndConnect (Task<VirtualMachine> asyncResult) { | ||
if (asyncResult == null) | ||
throw new ArgumentNullException ("asyncResult"); | ||
|
||
if (!asyncResult.IsCompleted) | ||
asyncResult.AsyncWaitHandle.WaitOne (); | ||
|
||
AsyncResult result = (AsyncResult) asyncResult; | ||
ConnectCallback cb = (ConnectCallback) result.AsyncDelegate; | ||
return cb.EndInvoke (asyncResult); | ||
asyncResult.Wait (); | ||
return asyncResult.Result; | ||
} | ||
|
||
public static void CancelConnection (IAsyncResult asyncResult) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ok with API breakages?