|
Display the call stack of the suspended thread
Return the size of the call stack
Return the line in source code the debuggee stopped at
When the execution of the debuggee is suspended, Bugloo can display informations about the call stack of the program. A call stack is the stack of every function that are still waiting for a result to return. An element of this stack is called a frame. Let the following example module:
If execution was suspended at line 7, invocation of the command (info stack) might return :
Frame #0 is the top of the stack : when execution will be resumed, the function %reverse will be the first to return. Note that name mangling is automatically applied, based on the function type Bugloo infers. 6.1.2 Setting the current frameYou can query informations on arguments that belong to a specific frame in the call stack. Instead of specifying the frame number each time you ask for argument values, you can tell Bugloo that you're working implicitely with a specific frame number :
Set the current frame number
Return the current frame number
Display name and value of all variables of the current frame
Display name and value of variable <varname>
Display name and value of the currently selected object. See chapter Debugging of Memory Allocation.
In the last example, the call of (info args) could have return :
6.2.2 Variables introspectionSometimes it might be usefull to introspect into objects instead of displaying their normal values. For example if you want to display values of slot or fields that may be hidden in normal circumstances.Bugloo provides introspection commodities à la Java :
Display each JVM fields of the local variable named <varname>
Display each JVM fields of the currently selected object. See chapter Debugging of Memory Allocation.
These three commands differ in the way they introspect their argument. The first one simply display each field defined in the JVM class of the argument. It uses the current Displayer in use by the Name Mangler in charge of the argument. It does not display values of a field that is an JVM array. This prevent screen flooding that can occurs when arrays are too large. The second one is more verbose. It recurse into arrays by displaying their elements. The last one acts like the second one, but is truly recursive. Whenever it must display a field that is a JVM class, the command recursively introspects into it.
Sometimes, showing the value of a variable is not sufficient to understand a bug. Rather, a more interactive way of debugging is often needed.
Evaluate a Scheme S-expression and print the result.
Evaluate a Scheme S-expression. Print the result and store it in the currently selected object.
By using print! instead of print, it is possible to store the result of the evaluation of the S-expression in %obj%, the currently selected object. For exemple, suppose that the debuggee is suspended at line 7 of the following program:
Suppose the user has resumed the debugger many times before and that local variables are in the following state:
The user can evaluate an S-expression, display and store its result by typing:
Later, he can reuse the result of the evaluation by referencing the currently selected object:
You can verify that using the print command will not overwrite the value of the currently selected object:
Start a new interpreter in the debuggee program Like the print command, local variables that are visible at the location the debuggee is suspended are captured and bound in the environment of the interpreter.
Unlike other languages, there's a native concept of threading in Java, and thus in the JVM. When the debuggee is suspended, Bugloo provides some commands to obtain some informations about the debuggee's threads.
Display a list of all threads present in the debuggee
Display the current thread
Set the current thread to be <threadnum>
Once the debuggee is suspended, the command (info threads) can be used to show the threads that reside in the debuggee VM. Invocation of this command might return something like:
Each line of output correspond to a thread in the JVM. The number inside the square brackets is the UID of the thread. It is a integer that uniquely identify a thread throughout its whole life. Next, this UID is followed by the name of the thread. At last, the information inside brackets correspond to the state of this thread when the debuggee execution was suspended. Every preceding commands seen in this chapter (like call stack visualization, variable inspection etc...) work on a per-thread basis. These commands operate on the current thread. By default, when the debuggee is suspended, the current thread is set to the thread that cause the suspension (e.g. the one who reached a breakpoint). Later you can choose the thread you want to inspect by setting another current thread. The argument <threadnum> is the UID returned after the invocation of the command (info threads). |