Browse Source

Fixed SD2-482: First command line argument not passed to debuggee;

Debugee version reported in log

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@672 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 21 years ago
parent
commit
645c22b31a
  1. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  2. 21
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -103,6 +103,8 @@ namespace DebuggerLibrary
corDebug.Initialize(); corDebug.Initialize();
corDebug.SetManagedHandler(managedCallbackProxy); corDebug.SetManagedHandler(managedCallbackProxy);
TraceMessage("ICorDebug initialized, debugee version " + debuggeeVersion);
} }
internal void TerminateDebugger() internal void TerminateDebugger()

21
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs

@ -81,46 +81,47 @@ namespace DebuggerLibrary
} }
return createdProcess; return createdProcess;
} }
static public unsafe Process StartInternal(NDebugger debugger, string filename, string workingDirectory, string arguments) static public unsafe Process StartInternal(NDebugger debugger, string filename, string workingDirectory, string arguments)
{ {
debugger.TraceMessage("Executing " + filename); debugger.TraceMessage("Executing " + filename);
_SECURITY_ATTRIBUTES secAttr = new _SECURITY_ATTRIBUTES(); _SECURITY_ATTRIBUTES secAttr = new _SECURITY_ATTRIBUTES();
secAttr.bInheritHandle = 0; secAttr.bInheritHandle = 0;
secAttr.lpSecurityDescriptor = IntPtr.Zero; secAttr.lpSecurityDescriptor = IntPtr.Zero;
secAttr.nLength = (uint)sizeof(_SECURITY_ATTRIBUTES); //=12? secAttr.nLength = (uint)sizeof(_SECURITY_ATTRIBUTES); //=12?
uint[] processStartupInfo = new uint[17]; uint[] processStartupInfo = new uint[17];
processStartupInfo[0] = sizeof(uint) * 17; processStartupInfo[0] = sizeof(uint) * 17;
uint[] processInfo = new uint[4]; uint[] processInfo = new uint[4];
ICorDebugProcess outProcess; ICorDebugProcess outProcess;
if (workingDirectory == null || workingDirectory == "") { if (workingDirectory == null || workingDirectory == "") {
workingDirectory = System.IO.Path.GetDirectoryName(filename); workingDirectory = System.IO.Path.GetDirectoryName(filename);
} }
fixed (uint* pprocessStartupInfo = processStartupInfo) fixed (uint* pprocessStartupInfo = processStartupInfo)
fixed (uint* pprocessInfo = processInfo) fixed (uint* pprocessInfo = processInfo)
debugger.CorDebug.CreateProcess( debugger.CorDebug.CreateProcess(
filename, // lpApplicationName filename, // lpApplicationName
arguments, // lpCommandLine // If we do not prepend " ", the first argument migh just get lost
" " + arguments, // lpCommandLine
ref secAttr, // lpProcessAttributes ref secAttr, // lpProcessAttributes
ref secAttr, // lpThreadAttributes ref secAttr, // lpThreadAttributes
1,//TRUE // bInheritHandles 1,//TRUE // bInheritHandles
0, // dwCreationFlags 0, // dwCreationFlags
IntPtr.Zero, // lpEnvironment IntPtr.Zero, // lpEnvironment
workingDirectory, // lpCurrentDirectory workingDirectory, // lpCurrentDirectory
(uint)pprocessStartupInfo, // lpStartupInfo (uint)pprocessStartupInfo, // lpStartupInfo
(uint)pprocessInfo, // lpProcessInformation, (uint)pprocessInfo, // lpProcessInformation,
CorDebugCreateProcessFlags.DEBUG_NO_SPECIAL_OPTIONS, // debuggingFlags CorDebugCreateProcessFlags.DEBUG_NO_SPECIAL_OPTIONS, // debuggingFlags
out outProcess // ppProcess out outProcess // ppProcess
); );
return new Process(debugger, outProcess); return new Process(debugger, outProcess);
} }
internal void Break() internal void Break()
{ {
if (!isProcessRunning) { if (!isProcessRunning) {

Loading…
Cancel
Save