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

Home » Public Forums » archive » Re: how to stop a procedure in idlwave
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: how to stop a procedure in idlwave [message #44614] Thu, 30 June 2005 20:57
Jess is currently offline  Jess
Messages: 11
Registered: June 2005
Junior Member
Hi JD,

Thanks for the detailed response. C-c C-y does what I need. But I will
experiement with setting breakpoints where I actually need to debug
properly.

- Jess
Re: how to stop a procedure in idlwave [message #44618 is a reply to message #44614] Thu, 30 June 2005 11:11 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 30 Jun 2005 07:49:46 -0700, Jess wrote:

> Hi All,
>
> I know this is a basic question, but I am having trouble stopping IDL
> procedures in IDLwave. In a normal IDL shell I found I could stop a
> running procedure by typing fullstop and C-c. I do this quite often,
> and find that I use it to examine variables in the subroutine that is
> currently being run or to fix a section before re-running. Sometimes
> this is in the middle of a loop, other times it is when IDL is waiting
> for user input at a read command.
>
> str = ''
> read,str,prompt='Enter string: '
>
> Running the same code in IDLwave I find it very difficult to stop a
> program and get back to an idl shell prompt. I've tried C-c C-z, and
> C-c C-c, to no avail. In the end I often have to kill the entire idl
> session within idlwave with C-c C-\.
>
> I know I can enter 'stop' in the code, at which point it will stop on
> re-run. But I would much rather an interactive, rather than pre-coding
> a stop command which requires anticipating where I will need to make
> amendments. Waiting til the program completes before making amendments
> can be quite some time, so I'd rather not do that either.
>
> Sorry I haven't already figured this out.
> Thanks,
> Jess
>
> nb: Usually I run a batch program that compiles all the procedures and
> functions I need and then runs the top-level program.


C-c C-c sends the same interrupt signal to the process that C-c does
in an xterm. I have found that sometimes, not always, IDL refuses to
respond to interrupts, so this is more of an issue with IDL than with
IDLWAVE.

As mentioned, IDLWAVE handles keyboard input to IDL differently than
an XTerm or IDLDE (since it allows you so much flexible editing power
at the command line). A return will always be sent to IDL, but if you
want other individual characters to be sent to IDL one at a time
(e.g. if it's waiting using GET_KBRD()), you need to enable "temporary
character mode" with C-c C-y.

If you have areas of code you are trying to stop in, I highly
recommend setting a breakpoint there. Just C-c C-d C-b on the line.
BP's can be removed, temporarily disabled, have trigger counts and
conditions, etc. (and try right-clicking on a BP line if you have the
latest IDLWAVE). Then you can use the examine commands to see what
your variables are doing. Far more flexible and predictable than
hoping you interrupt at the exact right moment. By the way, I often
use "h" in electric debug mode for this kind of thing: set a BP at the
beginning of a routine you're interested in debugging, then position
the cursor and use "h" to run to "here", so you don't have to step
through all the intermediate stuff. Alternatively, set several
approximate breakpoints, and use "r" to skip through them. You might
like to read up on the breakpoint and examine features in the manual.

JD
Re: how to stop a procedure in idlwave [message #44622 is a reply to message #44618] Thu, 30 June 2005 09:50 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
Jess wrote:
> Hi All,
>
> I know this is a basic question, but I am having trouble stopping IDL
> procedures in IDLwave. In a normal IDL shell I found I could stop a
> running procedure by typing fullstop and C-c. I do this quite often,
> and find that I use it to examine variables in the subroutine that is
> currently being run or to fix a section before re-running. Sometimes
> this is in the middle of a loop, other times it is when IDL is waiting
> for user input at a read command.
>
> str = ''
> read,str,prompt='Enter string: '
>
> Running the same code in IDLwave I find it very difficult to stop a
> program and get back to an idl shell prompt. I've tried C-c C-z, and
> C-c C-c, to no avail. In the end I often have to kill the entire idl
> session within idlwave with C-c C-\.
>
> I know I can enter 'stop' in the code, at which point it will stop on
> re-run. But I would much rather an interactive, rather than pre-coding
> a stop command which requires anticipating where I will need to make
> amendments. Waiting til the program completes before making amendments
> can be quite some time, so I'd rather not do that either.
>
> Sorry I haven't already figured this out.
> Thanks,
> Jess
>
> nb: Usually I run a batch program that compiles all the procedures and
> functions I need and then runs the top-level program.

C-c C-c works for me??? Of course if the program is waiting for
keyboard input, you have to give it that, too. What versions
(IDL,emacs,idl-wave) are you using? What OS? These might help to
figure it out(?)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: A question about Gaussian distributions in IDL
Next Topic: IDL code with fortran subroutine and C linker on OSX

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

Current Time: Fri Oct 10 07:36:50 PDT 2025

Total time taken to generate the page: 0.87862 seconds