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

Home » Public Forums » archive » Re: Debugging a widget program (someone else's)
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
Re: Debugging a widget program (someone else's) [message #84261] Thu, 09 May 2013 20:52
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Thanks Mike, the logging framework looks great for development of large projects. In my case, I was able to use PROFILER to list all the procedures used after pressing the widget button - though in alphabetical order rather than in the order they are called. But among the ~200 procedures listed, I was able to spot and debug the likely culprit. Cheers, --Wayne

On Thursday, May 9, 2013 7:14:42 PM UTC-4, Mike Galloy wrote:
> 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
Re: Debugging a widget program (someone else's) [message #84264 is a reply to message #84261] Thu, 09 May 2013 16:14 Go to previous message
Michael Galloy is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Newbie to IDL needs help :)
Next Topic: Q: project_vol

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

Current Time: Wed Oct 08 13:52:26 PDT 2025

Total time taken to generate the page: 0.00556 seconds