comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Debugging overload
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Debugging overload [message #88603] Fri, 16 May 2014 08:20 Go to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi again,

I'll continue my whishlist with something more important. Consider the
following program I'd like to debug:

pro debugging_overload

h = hash('key', INDGEN(10))

a = mean(h['key']) ; Put a breakpoint here

end

With the breakpoint, the program stops and I usually tip F5 (shortcut
for "step-into" in the debugger). Due to the operator overloading, the
"step into" is now requiring 31 (!) clicks:

IDL> debugging_overload
% Breakpoint at: DEBUGGING_OVERLOAD 5
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::GET
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
% Stepped to: MEAN 55
/usr/local/idlenvi/idlenvi83/idl83/lib/mean.pro

Anyone else having this issue?

Cheers,

Fabien
Re: Debugging overload [message #88605 is a reply to message #88603] Fri, 16 May 2014 12:44 Go to previous messageGo to next message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
Ask to have HASH and LIST implemented at the C level instead of .pro code or to have the debugger know how to step over "special" class methods autmatically. (I need more votes for either of these!) Contact support@exelisvis.com with your vote.

Jim P.
Re: Debugging overload [message #88607 is a reply to message #88603] Fri, 16 May 2014 14:58 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Friday, May 16, 2014 9:20:43 AM UTC-6, Fabien wrote:
> Hi again,
>
>
>
> I'll continue my whishlist with something more important. Consider the
>
> following program I'd like to debug:
>
>
>
> pro debugging_overload
>
>
>
> h = hash('key', INDGEN(10))
>
>
>
> a = mean(h['key']) ; Put a breakpoint here
>
>
>
> end
>
>
>
> With the breakpoint, the program stops and I usually tip F5 (shortcut
>
> for "step-into" in the debugger). Due to the operator overloading, the
>
> "step into" is now requiring 31 (!) clicks:
>
>

Can't you just do F6 or hit the Step Over button instead? Other than the fact that you can't see the pro code, I don't see much difference between this and stepping into something like "dist.pro". Also, even if you do accidentally step into a save file, you can hit F7 (Step Out) to immediately get back out.

Finally, in IDL 8.3.1 we are going to report line numbers for save files. This doesn't do you any good in this case (since you don't have the pro code) but for your own save files you might actually want to step through them as a save file but see the line numbers.

Cheers,
Chris
Re: Debugging overload [message #88609 is a reply to message #88607] Fri, 16 May 2014 17:19 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/16/14, 3:58 PM, Chris Torrence wrote:
> Can't you just do F6 or hit the Step Over button instead? Other than
> the fact that you can't see the pro code, I don't see much difference
> between this and stepping into something like "dist.pro". Also, even
> if you do accidentally step into a save file, you can hit F7 (Step
> Out) to immediately get back out.
>
> Finally, in IDL 8.3.1 we are going to report line numbers for save
> files. This doesn't do you any good in this case (since you don't
> have the pro code) but for your own save files you might actually
> want to step through them as a save file but see the line numbers.

So you are associating line numbers with byte code? What about a line
profiler? i.e., time spent on particular lines of code instead of just
in routines.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: Debugging overload [message #88610 is a reply to message #88607] Sat, 17 May 2014 01:54 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi Chris,

On 16.05.2014 23:58, Chris Torrence wrote:
> Can't you just do F6 or hit the Step Over button instead?

well I made an example with the IDL function "mean" but often when I
debug code I might want to step into the function I call to see if it's
responsible of the problem.

function debugging_overload_mean, array
return, mean(array)
end

pro debugging_overload
h = hash('key', INDGEN(10))
a = debugging_overload_mean(h['key']) ; breakpoint
end

Both F6 and F7 won't allow me to "follow" the content of the hash into
the function. I guess that's what the "step-into" button is made for ;)

Thanks,

Fabien
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Common block conumdrum
Next Topic: Coyote NCDF_FILE object to read HDF

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:11:48 PDT 2025

Total time taken to generate the page: 0.00703 seconds