locked
How to run more than one debug engine in a debug session? RRS feed

  • Question

  • I'm developping a debug engine for Lua. Now the lua part works fine. I wonder how to launch native C++ debug egine at the same time? The communication between debuggee and my debug engine is based on named pipe, so it should not conflict with C++ DE's WaitForDebugEvent. I guess I might specify the GUID of C++ DE in VsDebugTargetInfo structure, is it right? But I don't know what  the GUID of C++ DE is. Can anybody teach me how to handle that ?
    Thursday, November 1, 2012 6:38 AM

Answers

  • I think I have found the way. The first dlo should be DLO_CreateProcess, the second one can be either DLO_CreateProcess or DLO_Custom. The key point is I should traverse all IDebugProcess2 interfaces through IDebugPort2 in IDebugLauncher2::LaunchSuspended, and then "attach" to the target that has been launched by native C DE.

    • Marked as answer by Ego Jiang Monday, November 5, 2012 4:54 AM
    Friday, November 2, 2012 3:06 PM

All replies

  • I searched the register and found a GUID guidNativeOnlyEng. It seems it presents the native C++ DE. I met another problem:

    I hope the debuggee will be launched by native C++ DE, and then SDM attaches my Lua DE to the process. I am confused how to initialize VsDebugTargetInfo structure. Below is my code:

    VsDebugTargetInfo _dbgInfo[2];

    ZeroMemory(&_dbgInfo[0],

    sizeof(VsDebugTargetInfo));

    _dbgInfo[0].cbSize =

    sizeof(VsDebugTargetInfo);

    _dbgInfo[0].dlo = DLO_CreateProcess;

    _dbgInfo[0].clsidCustom = CLSID_NativeOnlyEngine;

       _exeFileName.CopyTo(&_dbgInfo[0].bstrExe);

    _exeCurPath.CopyTo(&_dbgInfo[0].bstrCurDir);

    ZeroMemory(&_dbgInfo[1],

    sizeof(VsDebugTargetInfo));

    _dbgInfo[1].cbSize =

    sizeof(VsDebugTargetInfo);

    _dbgInfo[1].dlo = DLO_CreateProcess; // <-- we'll have two instances of the debuggee, what is the correct parameter?

    _dbgInfo[1].clsidCustom = CLSID_LuaDebugEngine;

        _exeFileName.CopyTo(&_dbgInfo[1].bstrExe);

    _exeCurPath.CopyTo(&_dbgInfo[1].bstrCurDir);

    hr = _debugger->LaunchDebugTargets(2, _dbgInfo);

    Thursday, November 1, 2012 9:10 AM
  • I think I have found the way. The first dlo should be DLO_CreateProcess, the second one can be either DLO_CreateProcess or DLO_Custom. The key point is I should traverse all IDebugProcess2 interfaces through IDebugPort2 in IDebugLauncher2::LaunchSuspended, and then "attach" to the target that has been launched by native C DE.

    • Marked as answer by Ego Jiang Monday, November 5, 2012 4:54 AM
    Friday, November 2, 2012 3:06 PM
  • Hi ZhiXin,

    I’m glad to hear that you got it working.

    Thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 5, 2012 4:54 AM