Download microsoft.scripting.debugging.dll




















Any script that wishes to expose debugging capabilities to the debug host and the debugger application hosting the data model can do so by having debuggable scripts implement the IDataModelScriptDebug interface in addition to the IDataModelScript interface. The presence of this interface on the script indicates to the infrastructure that it is debuggable. While the IDataModelScriptDebug interface is the starting point to get access to the debug capabilities of a script provider, it is joined by a set of other interfaces in providing overall debug capabilities.

Any script which is debuggable indicates this capability via the presence of the IDataModelScriptDebug interface on the same component which implements IDataModelScript.

The query for this interface by the debug host or the debugger application hosting the data model is what indicates the presence of the debug capability. The GetDebugState method returns the current state of the script e. The state is defined by a value within the ScriptDebugState enumeration. The GetCurrentPosition' method returns the current position within the script. This may only be called when the script is broken into the debugger where a call to GetScriptState would return ScriptDebugBreak.

Any other call to this method is invalid and will fail. The GetStack method gets the current call stack at the break position. This method may only be called when the script is broken into the debugger. The SetBreakpoint method sets a breakpoint within the script. Note that the implementation is free to adjust the inpassed line and column positions to move forward to an appropriate code position. The actual line and column numbers where the breakpoint was placed can be retrieved by method calls on the returned IDataModelScriptDebugBreakpoint interface.

Each breakpoint which is created within the script via the SetBreakpoint method is assigned a unique identifier a bit unsigned integer by the implementation. The FindBreakpointById method is used to get an interface to the breakpoint from a given identifier. The EnumerateBreakpoints method returns an enumerator capable of enumerating every breakpoint which is set within a particular script.

The GetEventFilter method returns whether "break on event" is enabled for a particular event. Events which can cause "break on event" are described by a member of the ScriptDebugEventFilter enumeration.

The SetEventFilter method changes the "break on event" behavior for a particular event as defined by a member of the ScriptDebugEventFilter enumeration. A full list of available events and a description of this enumeration can be found in the documentation for the GetEventFilter method. The StartDebugging method "turns on" the debugger for a particular script. The act of starting debugging does not actively cause any execution break or stepping.

It merely makes the script debuggable and provides a set of interfaces for the client to communicate with the debugging interface. The StopDebugging method is called by a client that wants to stop debugging. This method call may be made at any point after StartDebugging was made successfully e.

The call immediately ceases all debugging activity and resets the state back to before StartDebugging was called. The debug host or debugger application which wishes to provide an interface around script debugging must provide an implementation of the IDataModelScriptDebugClient interface to the script debugger via the StartDebugging method on the debug interface for the script.

The IDataModelScriptDebugClient is the communication channel across which debug events are passed and control goes from the script execution engine to a debugger interface. It is defined as follows. Whenever any event occurs which breaks into the script debugger, the debug code itself makes a call to the interface via the NotifyDebugEvent method. This method is synchronous. No execution of the script will resume until the interface returns from the event.

The definition of the script debugger is intended to be simple: there are absolutely no nested events requiring processing. A debug event is defined by a variant record known as a ScriptDebugEventInformation.

Which fields in the event information are valid is largely defined by the DebugEvent member. It defines the kind of event which occurred as described by a member of the ScriptDebugEvent enumeration. When an event occurs which breaks into the script debugger, the debugging interface will want to retrieve the call stack for the break location.

This is done through the GetStack method. The call stack which is returned from a single call to the GetStack method on a particular script's debug interface should only return the segment of the call stack within the bounds of that script. It is entirely possible that a script debug engine can retrieve the call stack as spans multiple script contexts if two scripts of the same provider interact.

The GetStack method should not return the portion of the stack which is in another script. Instead, if this situation can be detected, the stack frame which is the boundary frame into the script should mark itself as a transition frame via an implementation of the IsTransitionPoint and GetTransition methods on that stack frame.

It is expected that the debugger interface will stitch together the overall stack from the multiple stack segments which exist. It is imperative that transitions be implemented in this manner or the debug interface may direct inquiries about local variables, parameters, breakpoints, and other script specific constructs to the wrong script context!

This will result in undefined behavior in the debugger interface. The GetFrameCount method returns the number of stack frames in this segment of the call stack.

If the provider can detect frames in different script contexts or of different providers, it should indicate this to the caller by implementation of the IsTransitionPoint and GetTransition methods on the entry frame into this stack segment. The GetStackFrame gets a particular stack frame from the stack segment. The call stack has a zero based indexing system: the current stack frame where the break event occurred is frame 0. The caller of the current method is frame 1 and so forth.

A particular frame of the call stack when broken into the script debugger can be retrieved via a call to the GetStackFrame method on the IDataModelScriptDebugStack interface representing the stack segment where the break occurred. The GetName method returns the display name e. Such name will be displayed within the stack backtrace presented to the user in the debugger interface.

The GetPosition method returns the position within the script represented by the stack frame. This method may only be called when the script is within a break represented by the stack in which this frame is contained. The line and column position within this frame is always returned. If the debugger is capable of returning the span of the "execution position" within the script, an ending position can be returned in the positionSpanEnd argument. If the debugger is not capable of this, the line and column values in the span end if requested should be set to zero.

The IDataModelScriptDebugStack interface represents a segment of a call stack -- that portion of the call stack which is contained within the context of one script. If the debugger is capable of detecting the transition from one script to another or one script provider to another , it can indicate this by implementing the IsTransitionPoint method and returning true or false as appropriate.

The call stack frame which entered the script where the segment applies should be considered a transition point. All other frames are not. If a given stack frame is a transition point as determined by the IsTransition method see the documentation there for a definition of transition points , the GetTransition method returns information about the transition. In particular, this method returns the previous script -- the one which made a call into the script represented by the stack segment containing this IDataModelScriptDebugStackFrame.

The Evaluate method evaluates an expression of the language of the script provider in the context of the stack frame represented by the IDataModelScriptDebugStackFrame interface on which this method was called. The result of the expression evaluation must be marshaled out of the script provider as an IModelObject. The properties and other constructs on the resulting IModelObject must all be able to be acquired while the debugger is in a break state.

A set of variables in the script being debugged whether those in a particular scope, the locals of a function, the arguments of a function, etc The Reset method resets the position of the enumerator to where it was immediately after creation -- that is, before the first element of the set. The GetNext method moves the enumerator to the next variable in the set and returns the variable's name, value, and any metadata associated with it. Script breakpoints are set via the SetBreakpoint method on a given script's debug interface.

Such breakpoints are represented both by a unique id and an implementation of the IDataModelScriptDebugBreakpoint interface which is defined as follows. The GetId method returns the unique identifier assigned by the script provider's debug engine to the breakpoint. This identifier must be unique within the context of the containing script. The breakpoint identifier may be unique to the provider; however, that is not required.

The IsEnabled method returns whether or not the breakpoint is enabled. A disabled breakpoint still exists and is still in the list of breakpoints for the script, it is merely "turned off" temporarily.

All breakpoints should be created in the enabled state. The Enable method enables the breakpoint. If the breakpoint was disabled, "hitting the breakpoint" after calling this method will cause a break into the debugger. The Disable method disables the breakpoint.

After this call, "hitting the breakpoint" after calling this method will not break into the debugger. The breakpoint, while still present, is considered "turned off". The Remove method removes the breakpoint from its containing list. The breakpoint no longer semantically exists after this method returns.

Nothing else can legally be done with it after this call other than releasing it. The GetPosition method returns the position of the breakpoint within the script. The script debugger must return the line and column within source code where the breakpoint is located.

If it is capable of doing so, it can also return a span of source represented by the breakpoint by filling out an end position as defined by the positionSpanEnd argument.

I've never tried running IronPython on Mono, but it should work. Note that the IronPython release targeting. NET 4. See this answer for more details. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 11 years, 3 months ago. Active 11 years, 3 months ago. Viewed 3k times. I have the following IronPython code. Hosting; using IronPython. Runtime; using IronPython; using Microsoft. Hosting; using Microsoft. In C , all names must be fully qualified. Any methods or variables must be in the current scope and context when the language service tries to evaluate the expression.

Assuming that Test takes one int parameter, evaluate Test using the Immediate window:. You can continue to debug Test by placing a breakpoint inside it, and then evaluating the function again.

The breakpoint will be hit, and you can step through Test. After execution has left Test , the debugger will be back in design mode. You can write a calling app for a DLL in managed or native code. If your native app calls a managed DLL and you want to debug both, you can enable both the managed and native debuggers in the project properties. The exact process depends on whether you want to start debugging from the DLL project or the calling app project.

For more information, see How to: Debug in mixed mode. You can also debug a native DLL from a managed calling project. For more information, see How to debug managed and native code. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback?



0コメント

  • 1000 / 1000