PL/SQL Debug (Oracle) for Visual Studio CodeThis extension allows you to debug your PL/SQL (Oracle) packages with Visual Studio Code. It uses remote debugging with the package DBMS_JDWP (Database side) and the node module JDWP with some adaptations for Oracle (vs code side). Database configurationFirst you will have to configure your database to allow remote debugging. You need to compile your package with PLSQL_OPTIMIZE_LEVEL = 1:
Then the user should have some rights to debug:
An ACL needs to be created to be able to connect to the computer that runs visual studio code:
Custom evaluationIt's now possible to evaluate other things than the local variables. For that, the extension needs to be in a java context to be able to invoke a method (it's not possible directly in Oracle context). I provide a sample file to configure the custom evaluation in your database. Then you need to provide the java class name and line in this class of the first instruction of the evalBreakpoint method in the Launch.json file (see below in extension configuration). In your packages, you can call the procedure evalBreakpoint where you want to make some custom evaluations. The debugger will automaticlly stops on this line (you don't need to put a breakpoint on it) and when the debugguer hit this breakpoint, you can evaluate values in the debug console or watcher: Important: when you are in this context, local variables values are not available, as you are currently in the java virtual machine! Extension configurationLaunch.jsonIn your project, you need to put this kind of configuraiton in launch.json file:
or
Note: watchingSchemas is very important! You need to specify all the schemas that you want to debug. When we start the debug, we put an event that will trigger on a class load. The problem is that currenctly we cannot use the '*' symbol to match several schema... UsageFor example: use this code to debug from sql+
StatusFor the moment, it's a minimalist debugger based on the vscode-mock-debug sample. What would be great to implement:
|