Mail Archives: djgpp/2000/02/20/14:49:58
On Fri, 18 Feb 2000, Shawn Hargreaves wrote:
> The Allegro handler doesn't kill the program in response to ctrl+c
> (that wouldn't be desirable for a majority of game/graphics type
> applications), but it does have an emergency exit combo, ctrl+alt+del
> or ctrl+alt+end, which is mapped onto the same thing (calls
> __djgpp_hw_exception with %al = 0x79), which causes libc to print
> the message about ctrl+c being pressed.
It would be better to simulate Ctrl-BREAK, not Ctrl-C, at least for
one of the two combinations. The ability to generate a full traceback
is a valuable feature.
> I presume this would be hooked in the same way as calling
> the ctrl+c handler, just with a different code?
Yes, the code is (surprise!) 0x1b, the number of the interrupt
generated by Ctrl-BREAK. See src/libc/go32/dpmiexcp.c in the library
sources.
You could also use 0x7a, which will trigger SIGQUIT, but you'd need to
enable SIGQUIT first, since it is disabled by default. See the docs
of the function `__djgpp_traceback_exit', for the gory details.
As yet another alternative, you could simply call `abort', which will
also print a traceback.
- Raw text -