Tuesday, July 1, 2008

ARC: Did You Know #3

Did you know you can "bootstrap" a debug session in ARC? You don't have to have any breakpoints set to start debugging. Simply clicking "step over" (F10) or "step in" (F11) will start a debug session and stop on the first line in the script.

This is a handy way to get ARC to quickly jump to the source code of a procedure or trigger you want to edit. For example, in this video I use this functionality to quickly jump into a procedure, edit it, and then verify my changes.

In the future the SQL Utility in ARC will hopefully have the ability to directly open procedures, triggers, and functions via the open command, but for now this is a convenient shortcut (as opposed to having to open the procedure properties dialog).

One thing to keep in mind is that once you have canceled the session and are inside the procedure buffer in the editor, you need to click "step over", "step in", or "start debug session" (Shift-F5) to start a new debug session, not "execute" (F5). Clicking "execute" will just attempt to execute the current buffer because you bootstrapped the initial debug session and there are no breakpoints set (breakpoints are how ARC usually decides if you want a debug session or if you just want to execute the script you are currently viewing). Hitting F10 or F11 will use the base script you started with as the driver for the debug session, which is likely what you intended.

Another alternative is to set a new breakpoint once you have the procedure buffer loaded in the editor. At that point the "execute" command will always start a debug session, and will always use your driver/base script to call the procedure.

No comments:

Post a Comment