none
Custom debug engine for debugging 64-bit application RRS feed

  • 질문

  • I am trying to implement my custom debug engine.

    I followed the example "Visual Studio Debug Engine Sample" and it debugs 32-bit application well.

    • https://code.msdn.microsoft.com/Visual-Studio-Debug-Engine-c2e21c0e

    However my target is a 64-bit application, I changed the projects properties.

    Platform target of the SampleEngine project is x64.

    Platform target of the ProjectLauncher is x86.

    So, ProjectLauncher.dll is x86, SampleEngine.dll is x64 and SampleEngineWorker.dll is x64.

    But, when I tried to debug a 64-bit application, the following exception appears:

    An exception of type 'System.Runtime.InteropServices.COMException' occurred in EngineTest.dll -(actual name of projectLauncher.dll) - but was not handled in user code
    Additional information: Unable to start program: 'E/Test/x64/Debug/test.exe'.

    The debugger is not properly installed. Cannot debug the requested type of code. Run setup to install or repair the debugger.

    if there is a handler for this exception, the program may be safely contineued.

    Based on this exception, I'm guessing that the information of my custom debug engine is not sufficient to debug 64-bit application.

    Here are what I tried to handle this problem

    1. Build SampleEngine and SampleEngineWorker as x86 dll, and set alwaysLoadLocal true for the custom debugEngine registry.

    -> My debug engine tried to createprocess a 64-bit application with debug attribute, but failed to createProcess.

    -> createProcess a 64-bit application with debug attribute must called by a 64-bit process.

    2.  Build SampleEngine and SampleEngineWorker as x64 dll, and set alwaysLoadLocal true for the custom debugEngine registry

    -> In this case, SampleEngine*.dll is not loaded and same exception appears.

    -> alwaysLoadLocal should be set to false(reference).

    • reference: https://social.msdn.microsoft.com/Forums/en-US/9bd2f78f-cd06-4efd-9964-eb47a52f564a/launching-64-bit-using-ivsdebuggerlaunchdebugtargets-returns-0x89710016?forum=vsx

    My question is..

    1. How to debug 64-bit application with a custom debug engine? What did I miss?

    2. How can I print traces of debug process as I can see in "reference"?  

    • reference: https://social.msdn.microsoft.com/Forums/en-US/9bd2f78f-cd06-4efd-9964-eb47a52f564a/launching-64-bit-using-ivsdebuggerlaunchdebugtargets-returns-0x89710016?forum=vsx
    2019년 3월 25일 월요일 오후 1:16