locked
Getting the Debugger Object from VS2008 for scripted debugging RRS feed

  • Question

  • I am running VS2008 and Platform Builder "7", and am trying to write a script for semi-automated debugging of a subsystem.  I want to write a script to handle this, but am having issues with getting the debugger object.  I've tried several different methods, and have not succeeded when connected to my target (in a halted state).  I have no trouble getting the watch window to evaluate the object in question.

    All target attempts have yielded the same failure symptoms.  When I execute the GetExpression statement, the debugger appears to take one step forward, and the macro never completes.  I have to shut down VS2008 in order to try again.

    Method 1:
            DTE2 = System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.8.0")
            expression = DTE2.Debugger.GetExpression("(unsigned int)myVar", True, 10)

    Method 2:
            Dim debugger As EnvDTE.Debugger
            debugger = _applicationObject.Debugger
            expression = debugger.GetExpression("(unsigned int)myVar", True, 10)

    Method 3:
            Dim debugger2 As EnvDTE.Debugger
            debugger2 = DTE.Debugger
            expression = debugger2.GetExpression("(unsigned int)myVar", True, 10)


    As I said, all of these work on the PC version of my build, but none of them work on my target.

    Any ideas?
    Thanks!
    Monday, November 2, 2009 8:46 PM

Answers