[m-dev.] Suggestion: ^C throws an exception
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Nov 22 23:06:53 AEDT 1999
On 22-Nov-1999, Ralph Becket <rbeck at microsoft.com> wrote:
> > > It occurred to me when using the debugger, after I'd
> > > accidentally printed
> > > out a huge term for the second time,
> >
> > How did you print the term out? Do you mean with io__write
> > or the like in the code being debugged?
>
> No, this was in the term browser in the debugger. I'm happy to admit that
> I haven't really got to grips with mdb, but when you do make a mistake like
> the above it's nice to have some way of cancelling without losing the entire
> debugging session.
The term browser has limits on the size of the terms that it displays.
So I don't quite understand how you would accidentally print out a huge
term, unless perhaps you had explicitly set those limits very high.
Was that the case?
> > However, I think it would be possible to put in a signal handler that
> > caught ^C and set a global variable to tell the debugger to
> > stop at the
> > next trace event. So you could interrupt a `continue'
> > command, for example.
> > The user would get control whenever execution next reached code
> > that was compiled with debugging enabled. In fact that would not be
> > very hard to implement at all. [... a couple of hours pass ...]
> > Hmm, perhaps a little harder than I first thought, but anyway
> > easy enough. See the diff that I posted in a separate mail.
>
> That's just what I was after!
If the problem was indeed output in the term browser,
the diff that I posted wouldn't help, since debugging
would be disabled for all the term browser output code,
and so the next debugging event would only occur _after_
the term browser had finished all of its output, and
the user had returned to the mdb prompt and issued a
command to continue execution.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list