package cpp.vm
Available on cpp
This class wraps the hxcpp C++ implementation to provide a Haxe interface to the low level debugging features
staticNONEXISTENT_VALUE:String = "NONEXISTENT_VALUE"
This tagging value is returned by getStackVariableValue()
and setStackVariableValue()
if the requested value does not exist at the requested stack frame
staticinlineread onlySTEP_INTO:Int = 1
staticinlineread onlySTEP_OUT:Int = 3
staticinlineread onlySTEP_OVER:Int = 2
staticinlineread onlyTHREAD_CREATED:Int = 1
staticTHREAD_NOT_STOPPED:String = "THREAD_NOT_STOPPED"
This tagging value is returned by getStackVariableValue()
and setStackVariableValue()
if the stack variable that is being set is on a thread that is running, in which case the set does not take place.
staticinlineread onlyTHREAD_STARTED:Int = 3
staticinlineread onlyTHREAD_STOPPED:Int = 4
staticinlineread onlyTHREAD_TERMINATED:Int = 2
staticaddClassFunctionBreakpoint(className:String, functionName:String):Int
Adds a new class:function
breakpoint. The breakpoint number of the newly added breakpoint is returned.
staticaddFileLineBreakpoint(file:String, line:Int):Int
Adds a new file:line
breakpoint. The breakpoint number of the newly added breakpoint is returned.
staticbreakNow(wait:Bool = true):Void
Breaks all threads except the debugger thread (which should be the same as the calling thread!).
If wait
is true
, waits up to 2 seconds for all threads to be broken. Threads which are in blocking system calls and cannot break after 2 seconds remain running when this function returns.
staticcontinueThreads(specialThreadNumber:Int, continueCount:Int):Void
Continue execution of all stopped threads. If specialThreadNumber
is a valid thread number, then it will be continued past continueCount
breakpoints instead of just 1 like all of the other threads.
staticdeleteBreakpoint(number:Null<Int>):Void
Deletes a breakpoint, or all breakpoints.
staticenableCurrentThreadDebugging(enabled:Bool):Void
This can be called to turn off (and then back on) all stopping of debugged threads temporarily. It should only be used by classes that actually implement the debugger to hide themselves from the debugger as necessary.
staticgetClasses():Array<String>
Returns the set of class names of all classes known to the debugger. This is a copy of the original array and could be quite large. The caller should cache this value to avoid multiple copies needing to be made.
Returns:
staticgetCurrentThreadNumber():Int
Returns the thread number of the calling thread.
Returns:
staticgetFiles():Array<String>
Returns the set of source files known to the debugger. This is a copy of the original array and could be quite large. The caller should cache this value to avoid multiple copies needing to be made.
Returns:
staticgetFilesFullPath():Array<String>
Returns the full paths of the set of source files known to the debugger. This is a copy of the original array and could be quite large. It is possible that this set will be empty, in which case the full paths are not known. The index of these files matches the index from getFiles()
, so the full path for a given short path can be calculated.
Returns:
staticgetStackVariableValue(threadNumber:Int, stackFrameNumber:Int, name:String, unsafe:Bool):Dynamic
Returns the value of a stack variable, or NONEXISTENT_VALUE
if the requested value does not exist. If the thread is actively running and unsafe
is not true
, returns THREAD_NOT_STOPPED
.
staticgetStackVariables(threadNumber:Int, stackFrameNumber:Int, unsafe:Bool):Array<String>
Returns the list of local variables (including this
, function arguments, and local variables) visible to the given thread at the given stack frame.
Returns a list with a single entry, THREAD_NOT_STOPPED
, if the thread is not stopped and thus variables cannot be fetched and unsafe
is not true
.
Returns:
this
, function arguments, and local variables) visible to the given thread at the given stack frame.staticgetThreadInfo(threadNumber:Int, unsafe:Bool):ThreadInfo
Returns a ThreadInfo
object describing a single thread, or null
if there is no such thread or the thread queried about was the debugger thread and unsafe
was not true
.
staticgetThreadInfos():Array<ThreadInfo>
Returns a ThreadInfo
object describing every thread that existed at the moment that the call was made, except for the debugger thread.
staticsetEventNotificationHandler(handler:(threadNumber:Int, event:Int, stackFrame:Int, className:String, functionName:String, fileName:String, lineNumber:Int) ‑> Void):Void
Sets the handler callback to be made when asynchronous events occur, specifically, when threads are created, terminated, started, or stopped. The calling thread becomes the "debugger" thread, which means that it will be discluded from any breakpoints and will not be reported on by any thread reporting requests.
Be aware that this callback is made asynchronously and possibly by multiple threads simultaneously.
Setting this to null
prevents further callbacks.
Throws a string exception if the program does not support debugging because it was not compiled with the HXCPP_DEBUGGER
flag set.
Parameters:
handler |
is a function that will be called back by asynchronous thread events. Note that this function is called directly from the thread experiencing the event and the handler should return quickly to avoid blocking the calling thread unnecessarily. The parameters to handler are:
|
---|
staticsetStackVariableValue(threadNumber:Int, stackFrameNumber:Int, name:String, value:Dynamic, unsafe:Bool):Dynamic
Sets the value of a stack variable and returns that value. If the variable does not exist, on the stack, this function returns NONEXISTENT_VALUE
. If the thread is actively running and unsafe
is not true
, returns THREAD_NOT_STOPPED
, and the value is not set.
staticstepThread(threadNumber:Int, stepType:Int, stepCount:Int = 1):Void
Single steps the given thread.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/cpp/vm/Debugger.html