> Hi, > > I've been hitting some problems running gdb against live processes on > ia64 nodes, often stack traces are incomplete due to signal handler > issues or such like. If running gdb interactively then gdb drops back > to the prompt and everything is fine but if run in batch mode it stops > parsing the batch file and exits. > > The problem here is that it does not detach before quiting so the > process becomes a zombie. Attached is a patch to prevent this. I've committed the attached (mainline and 6.2). Even when the script didn't abort GDB would kill the attached inferior :-( As for getting GDB to return a non-zero exit when the batch script fails - yes but it is a separate bug. We'd need to record that the script failed and exit non-zero based on that. Andrew > Ashley, > > *** gdb-6.1/gdb/main.c 2004-02-18 00:21:00.000000000 +0000 > --- gdb-6.1-modified/gdb/main.c 2004-04-29 14:10:17.000000000 +0100 > *************** > *** 736,742 **** > init_history (); > > if (batch) > ! { > /* We have hit the end of the batch file. */ > exit (0); > } > --- 736,752 ---- > init_history (); > > if (batch) > ! { > ! if ( attach_flag) { > ! /* If there is a problem executing the command in the batch file > ! * then we might not have parsed all of it and might be attached. > ! * Simply calling exit() would leave zombies so be nice and detach > ! * but let the user know that there was a problem. > ! */ > ! target_detach(NULL,0); > ! exit(1); > ! } > ! > /* We have hit the end of the batch file. */ > exit (0); > }