This tool provides you with an advanced editor and debugger for developing PL/SQL objects.
On the top of the screen is the toolbar for the debugger.
Below that to the left are two panes. The top one Objects contains the available objects in the selected schema. The schema is selectable through the toolbar. Select the code object you want to debug or edit in this list or start a new object before starting to edit the code.
The lower pane Contents contains the structure of the selected object. Here you can find declared methods of packages and also variables or even anonymous blocks in your code. Selecting a line in this pane will move the cursor to where the element is in your code, for instance where a variable or method is declared.
To the right is a large editor area where you can edit the current object. The editor is described in more detail later.
The last part of the screen is not always visible. It contains information about the currently running debugging session.
The toolbar and menu contain pretty much the same commands with a few exceptions.
When you run a program and make a change, but still decide to keep stepping through your program without restarting you can have one other changed file plus the current file, if you try to step to another object TOra will ask if you want to continue until you are back in the edited files or recompile.
Another thing special in this editor is that the PL/SQL editor will show you errors in the package. The errors are highlighted with a special background color (The default is red, but this is configurable in the options(see Options). You can also use the next error or previous error toolbar button/menu entries to step between the errors.
Next thing to know about the debugger is breakpoints. You can set a breakpoint either by selecting the toggle breakpoint toolbar button or menu entry. This will add a breakpoint to the line you are currently on in the editor. To remove the breakpoint simply select toggle breakpoint again. Another way to add or remove breakpoints is to double-click in the left margin of the editor where you also see where the breakpoints are. They are indicated by a small stop sign in the margin. If you want to temporarily disable a breakpoint that you might need to enable again later you can also choose disable breakpoint, this is also a toggle so selecting the command again will re-enable the breakpoint. For those of you who don't know breakpoints means that when execution of the object comes to the line containing the breakpoint the debugger will stop and allow you to inspect the data.
Which brings us to the last special thing in this editor which is the current line of execution, this is an indication of where the execution currently is at. This line is indicated by a special background (Default is green, but that is configurable in the options(see Options)).
Information about the current state of execution is shown in the pane at the bottom of the debugger window which you can be hidden. You hide or show this by selecting the command debug pane command or by pressing the F11 key. The debug pane consist of several tabs containing the following information.
Watches are a way to inspect the contents of variables in a running program. When you add a watch using the add watch command you are presented with the following dialog.
First of all you need to select the scope the variable is declared in. The local scope is variables only declared in the current context, like for instance this function or procedure. The head and body are variables declared in packages. Variables in packages are usually also available in the global scope. When you declare a watch in any scope except for local you should also indicate the object in which the variable is declared in the format schema.object.variable. The current object is prepended to the variable name when you select anything but the local scope.
Finally you have to fill out the variable name. If you have the cursor on a variable in the editor that name is the default when you add the watch.
You can then see the contents of this variable in the watch pane of the debugger info. The value will be updated every time execution stops while you are debugging. If the variable can not be found it will be {Unavailable}. If all variables are unavailable even though they shouldn't you have probably forgotten to compile the object with the debug option. You can remedy this by simply using the compile command. TOra will always compile programs using the debug option when in the PL/SQL debugger.
TOra can also inspect list and table object which will show up as child items in the list to the variable. When this is a case you can also see how many items an array is having in the parent of the actual data items.
You can remove a watch by selecting it in the watch list and selecting the remove watch command.
You can also change the content of a watch. First you select the watch you want to change in the watch list, then you select the change watch command. You will be shown this dialog.
If you have selected the parent of an array watch you will be able to select the index you want to assign a new value with the index indicator to right. Then you enter the new value in the text field or check the NULL indicator to set the value to NULL.