Toad World® Forums

Step through package initialization

Step through package initialization still doesn’t work. I have it turned off and it keeps stepping through anyway.

I’m pretty sure we’ve discussed this before. I still have the email in my “outstanding issues” where I filed this June of 2014 discussing it with Mike Hamer.

I’m having the issue in the latest beta, 64-bit, 11.2.0.1 client, 10.2.0.3 and 12.1.0.2 database.

Chris Johnson

IT Systems Analyst

Distribution Logistics

615-855-4371

Chris,

I’m not sure why it’s not working for you. I just whipped up a quick sample and with that option unchecked, it doesn’t step through the package initialization and if I check it, it does step through (using Trace into (Shift F7) to debug into). What exactly are you seeing?

Thanks,

Greg

create
or
replace
package
debugstuff

is

testvar number
:=
6;

package_var number
:=
4;

function TestStep (in_val number)

  return

number;

end
debugstuff;

/

drop
package
body
DEBUGSTUFF;

create
or
replace
package
body
debugstuff

as

function TestStep (in_val number)

  return

number

is

begin

  return testvar + package_var + in_val;

end TestStep;

end
debugstuff;

/

From: crjohnso [mailto:bounce-crjohnso@toadworld.com]

Sent: Thursday, August 13, 2015 2:14 PM

To: toadoraclebeta@toadworld.com

Subject: [Toad for Oracle - Beta Discussion Forum] Step through package initialization

Step through package initialization

Thread created by crjohnso

Step through package initialization still doesn’t work. I have it turned off and it keeps stepping through anyway.

I’m pretty sure we’ve discussed this before. I still have the email in my “outstanding issues” where I filed this June of 2014 discussing it with Mike Hamer.

I’m having the issue in the latest beta, 64-bit, 11.2.0.1 client, 10.2.0.3 and 12.1.0.2 database.

Chris Johnson

IT Systems Analyst

Distribution Logistics

615-855-4371

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - Beta
notifications altogether.

Toad for Oracle - Beta Discussion Forum

Flag
this post as spam/abuse.

Ah, okay, I see the communication failure now. I used your package and tested it both way and I see what you mean, and I agree that it works as I would expect that way.

Now, change the package body like this:

CREATE
OR
REPLACE
PACKAGE
BODY
DG_ABPPTM.debugstuff
AS

  v_test  VARCHAR2(1)

:=
‘x’;

  v_date  DATE;



  FUNCTION TestStep(in_val NUMBER)

        RETURN

NUMBER
IS

  BEGIN

        RETURN testvar + package_var + in_val;

  END TestStep;

BEGIN

  SELECT

SYSDATE
INTO v_date FROM DUAL;

END
debugstuff;

/

When you step into it, without regard to how the option is set, it will step first to all package BODY variables that have initial values, then to the package initialization, in this case the ‘select sysdate into…’ at the end of the package, then to the function. Maybe we are misinterpreting the definition of “package initialization”. To us that means variables in the spec as well as the body and we also consider the begin/end logic to be package initialization. We use that all the time for global variable default initialization.

Of course if I ‘run to cursor’ via F12 on the first line of the function/procedure then it bypasses all of that and starts at the selected line.

From: Gregory Liss [mailto:bounce-GTDG@toadworld.com]

Sent: Thursday, August 13, 2015 1:40 PM

To: toadoraclebeta@toadworld.com

Subject: RE: [Toad for Oracle - Beta Discussion Forum] Step through package initialization

RE: Step through package initialization

Reply by Gregory Liss

Chris,

I’m not sure why it’s not working for you. I just whipped up a quick sample and with that option unchecked, it doesn’t step through the package initialization and if I check it, it does step through (using Trace into (Shift F7) to debug into). What exactly are you seeing?

Thanks,

Greg

create
or
replace
package
debugstuff

is

testvar number
:=
6;

package_var number
:=
4;

function TestStep (in_val number)

  return

number;

end
debugstuff;

/

drop
package
body
DEBUGSTUFF;

create
or
replace
package
body
debugstuff

as

function TestStep (in_val number)

  return

number

is

begin

  return testvar + package_var + in_val;

end TestStep;

end
debugstuff;

/

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - Beta
notifications altogether.

Toad for Oracle - Beta Discussion Forum

Flag
this post as spam/abuse.

Thanks for the clarification Chris. For us, initialization has always meant the Package Spec but I can see where your definition is probably more accurate. I’ll take a peek but it may simply be beyond the capability of the DBMS_DEBUG API. As far as begin/end goes, that’s another item where Oracle tells us what line to go to and depending on the DB version, those are included. Thank you Larry for the nice consistent behavior. :wink:

Greg

On Aug 14, 2015, at 9:25 AM, crjohnso bounce-crjohnso@toadworld.com wrote:

RE: Step through package initialization

Reply by crjohnso
Ah, okay, I see the communication failure now. I used your package and tested it both way and I see what you mean, and I agree that it works as I would expect that way.

Now, change the package body like this:

CREATE OR REPLACE PACKAGE BODY DG_ABPPTM.debugstuff AS

  v_test  VARCHAR2(1) := 'x';
  v_date  DATE;
  FUNCTION TestStep(in_val NUMBER)
        RETURN NUMBER IS
  BEGIN
        RETURN testvar + package_var + in_val;
  END TestStep;

BEGIN

  SELECT SYSDATE INTO v_date FROM DUAL;

END debugstuff;

/

When you step into it, without regard to how the option is set, it will step first to all package BODY variables that have initial values, then to the package initialization, in this case the ‘select sysdate into…’ at the end of the package, then to the function. Maybe we are misinterpreting the definition of “package initialization”. To us that means variables in the spec as well as the body and we also consider the begin/end logic to be package initialization. We use that all the time for global variable default initialization.

Of course if I ‘run to cursor’ via F12 on the first line of the function/procedure then it bypasses all of that and starts at the selected line.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for Oracle - Beta notifications altogether.

Toad for Oracle - Beta Discussion Forum

Flag this post as spam/abuse.

Okay, cool. At least we’re on the same page now. If it becomes an issue such that the API doesn’t support it I can live with that (like I have a choice), but at least it will be explainable.

I just had a discussion with a contractor heading back to India and I asked him if he was familiar with the movie “The Princess Bride”. I said “You keep saying you are “going home”, I don’t think it means what you think it means”.

Applied to our current situation… You keep using that phrase “package initialization”. I don’t think it means what WE think it means.

From: Gregory Liss [mailto:bounce-GTDG@toadworld.com]

Sent: Friday, August 14, 2015 8:40 AM

To: toadoraclebeta@toadworld.com

Subject: RE: [Toad for Oracle - Beta Discussion Forum] Step through package initialization

RE: Step through package initialization

Reply by Gregory Liss

Thanks for the clarification Chris. For us, initialization has always meant the Package Spec but I can see where your definition is probably more accurate. I’ll take a peek but it may simply be beyond the capability of the DBMS_DEBUG API. As far as begin/end goes, that’s another item where Oracle tells us what line to go to and depending on the DB version, those are included. Thank you Larry for the nice consistent behavior. :wink:

Greg

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - Beta
notifications altogether.

Toad for Oracle - Beta Discussion Forum

Flag
this post as spam/abuse.

Ha ha! You fool! You fell victim to one of the classic blunders - The most famous of which is “never get involved in a land war in Asia” - but only slightly less well-known is this: “Never go in against a Toad Developer when a bug is on the line”! Ha ha ha ha ha ha ha! Ha ha ha ha ha ha ha! Ha ha ha…

On Aug 14, 2015, at 10:59 AM, crjohnso bounce-crjohnso@toadworld.com wrote:

RE: Step through package initialization

Reply by crjohnso
Okay, cool. At least we’re on the same page now. If it becomes an issue such that the API doesn’t support it I can live with that (like I have a choice), but at least it will be explainable.

I just had a discussion with a contractor heading back to India and I asked him if he was familiar with the movie “The Princess Bride”. I said “You keep saying you are “going home”, I don’t think it means what you think it means”.

Applied to our current situation… You keep using that phrase “package initialization”. I don’t think it means what WE think it means.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - Beta
notifications altogether.

Toad for Oracle - Beta Discussion Forum

Flag
this post as spam/abuse.