Debugging overload [message #88603] |
Fri, 16 May 2014 08:20  |
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 #88607 is a reply to message #88603] |
Fri, 16 May 2014 14:58   |
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 #88610 is a reply to message #88607] |
Sat, 17 May 2014 01:54  |
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
|
|
|