Bug(s) in debugger? Breakpoint stepping for nested HASH's. [message #79687] |
Thu, 22 March 2012 15:37 |
JDS
Messages: 94 Registered: March 2009
|
Member |
|
|
Add a breakpoint to the foreach line in this:
;===============
hash=hash('foo',hash('a','twenty','b','thirty'), $
'boo',hash('y','unicorn','z','pixie'))
foreach item,hash['boo'],itemname do begin
print,itemname,': ',item
endforeach
END
;===============
and attempt to step through. Two issues:
1) you must use .so to step "over" the hash calls (even implicit ones like hash indexing), since the debugger for some unknown reason steps *into* the opaque routine HASH, e.g.:
IDL> .s 1
% Stepped to: HASH::_OVERLOADBRACKETSRIGHTSIDE
Since we don't have source code to HASH, stepping into it seems rather unhelpful.
2) you can't step through this loop to completion, although it compiles and runs cleanly. The complaint:
% String expression not allowed in this context: ITEM.
% Execution halted at: $MAIN$ 6
This seems to be specific to iterating over a hash nested inside another one. I'd guess the debugger is rather confused about the new hash iteration in foreach.
JD
|
|
|