Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!sun-barr!rutgers!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: assertions and debuggers Message-ID: <14186:Sep2105:48:2290@kramden.acf.nyu.edu> Date: 21 Sep 90 05:48:22 GMT References: <10835@rama.UUCP> Distribution: usa Organization: IR Lines: 17 In article <10835@rama.UUCP> lvw@rama.UUCP (Lyndon VanWagner) writes: > On the VAX, we have been able to redefine the assert macro to place > us into the VMS debugger at the point of error, rather than just > exiting the program. [ and in UNIX? ] Why not just change the exit() to an abort()? Or, if you really want to hard-code dumping the user into the debugger: switch(fork()) { case -1: send some intelligent error message and die; case 0: abort(); default: wait((int *) 0); execlp("dbx","dbx",argv[0],(char *) 0); die horribly; } You should put this into a function so that the code isn't replicated at each assert(). (Side note: I typed that in without having to think about it. How long did your VMS solution take? Followups to alt.religion.computers.) ---Dan