Debugging external session in TOAD throws continuous errors

Hello - I'm attempting to use the TOAD debugger for the first time (no one at our company had tried it before), and went through the setup instructions. While it is definitely 'attempting' to run, it throws LOTS of errors - the first one:

Probe: Exception raised in the DBMS_DEBUG package"

comes up immediately upon connecting to the debug session, and any time you try to execute any debug command (step through, continue, etc.) It only has the option to click "OK" - when you do, it pops up again and again and again. Eventually though, it throws the second error:

ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "SYS.PBRPH", line 617
ORA-06512: at "SYS.DBMS_DEBUG", line 478
ORA-06512: at line 5

This has the typical TOAD error options (KB Search, details, etc), and automatically opens up a package presumably to debug the error. The package it opens, as well as the location inside the package, is seemingly random.

I presume I've done something wrong at a basic level to cause all of these errors - I followed the instructions in the help files, including doing grant connect to, and on the external session, the compiled SQL looks like:

BEGIN EXECUTE IMMEDIATE q'[alter session set PLSQL_DEBUG=TRUE]'; END;
DECLARE
id VARCHAR2(255);
BEGIN
id := DBMS_DEBUG.INITIALIZE('TOAD_EXAMPLE');
DBMS_DEBUG.DEBUG_ON;
su_login.rest_Login(p_szUserName=>:p_szUserName,p_szPassword=>:p_szPassword,p_szLoginAsUserName=>:p_szLoginAsUserName,po_rcUser=>:po_rcUser,po_rcSession=>:po_rcSession,po_szCompanyName=>:po_szCompanyName,po_jcSessionVars=>:po_jcSessionVars,po_rcUserPlatforms=>:po_rcUserPlatforms,po_rcAllPlatforms=>:po_rcAllPlatforms,po_rcAllDivisions=>:po_rcAllDivisions,po_rcAllFields=>:po_rcAllFields,po_rcMenus=>:po_rcMenus,po_rcAllAppVars=>:po_rcAllAppVars,po_rcRolesForUSer=>:po_rcRolesForUSer,po_rcApplicationRoles=>:po_rcApplicationRoles,po_rcStatus=>:po_rcStatus);
END;

Any advice on what high level thing I could be doing wrong?

Hi Chris,

What version of Toad are you using? A good write up of some of the requirements for debugging can be found here. Are you able to debug a local session?

Edit: Make sure you have compiled your code with debug as well.

Thanks for the fast response - I stepped through the guide you gave me, and had no issues at all. I went back after to try again (a bit more knowledgeable), and you were right, I wasn't compiling with debug.

However, even though I have the privileges granted (local debug wouldn't have worked without it I don't believe?), I still get ORA-01031 when I attempt to compile any of our real packages with debug. It still seems to be "somewhat working", but is there any other permission I might need other than grant DEBUG CONNECT SESSION to <my_schema>; for external session debugging? Is there per chance a similar guide on external session debugging?

The ORA-01031 could be due to any number of missing privileges, I'm not sure which would be specific to your setup though.

Other than what's in our help documentation (Debug External Sessions) I believe that's all we've got but if you're able to get the missing privileges you should be able to remotely debug as well.