Re: Debugging a widget program (someone else's) [message #84264 is a reply to message #84261] |
Thu, 09 May 2013 16:14  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 5/9/13 3:03 pm, wlandsman wrote:
> I'm looking for generic advice on how to debug a large widget
> program. Right now I press on a button and it displays an
> incorrect value. But I don't have any idea where to insert a
> breakpoint in the thousands of lines of code to debug the problem.
> Yes, I could look at the widget creation section for the button, then
> look for the event handler, and then try to follow the hierarchy of
> procedures until I find the function doing the calculations.
>
> What I would really like is some sort of procedure event log, that
> could show me in order the procedures and functions that are called
> after I press the button. Sort of like a reverse traceback that
> tells me where I am going rather than how I got where I am ;-)
>
> I vaguely recall reading about something like this, but maybe it
> wasn't in IDL.
>
> Thanks, --Wayne
>
You could use something like my logging framework, but that would
require putting a line in each routine you cared about. Something as
simple as:
mg_log, '', /debug
When the widget program was initialized, you would want to start up the
logging system with something like:
mg_log, level=5, filename='widget.log'
You can change the level to less than 5 to turn off the /DEBUG messages.
More information at:
http://michaelgalloy.com/2011/11/17/logging.html
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
|
|
|