From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Eli Zaretskii , gdb@sources.redhat.com Subject: Re: DOS/Windows-specific code: maint.c Date: Tue, 08 May 2001 23:40:00 -0000 Message-id: <1010509064000.ZM22251@ocotillo.lan> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> <200105081148.OAA06245@is.elta.co.il> X-SW-Source: 2001-05/msg00165.html On May 8, 2:48pm, Eli Zaretskii wrote: > * maint.c: > > #ifndef _WIN32 > /* ARGSUSED */ > static void > maintenance_dump_me (char *args, int from_tty) > { > if (query ("Should GDB dump core? ")) > { > #ifdef __DJGPP__ > /* SIGQUIT by default is ignored, so use SIGABRT instead. */ > signal (SIGABRT, SIG_DFL); > kill (getpid (), SIGABRT); > #else > signal (SIGQUIT, SIG_DFL); > kill (getpid (), SIGQUIT); > #endif > } > } > #endif > > Should we define SIGNAL_TO_DUMP_CORE (default to SIGQUIT)? It could > then be set to 0 on Windows, and maintenance_dump_me could print a > suitable message ("not supported on this platform" or some such) if > its value is zero. > > Btw, why isn't SIGABRT used on Unix here? I don't know. SIGABRT seems like a better (more portable) choice. With that in mind, why not do the following: /* ARGSUSED */ static void maintenance_dump_me (char *args, int from_tty) { if (query ("Should GDB dump core? ")) { #ifdef SIGABRT signal (SIGABRT, SIG_DFL); kill (getpid (), SIGABRT); #else error ("Not supported on this platform."); #endif } } Note that the _WIN32 ifdef has been removed so that maintenance_dump_me() will always be defined. If, for some reason, the above won't work, I think your SIGNAL_TO_DUMP_CORE suggestion is okay too. Kevin