This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb gets suspended during debugging


Hi everyone,

I've discovered that GDB will get suspended/backgrounded when debugging
if it produces a terminal height worth of the "Detaching after fork from
child process..." messages.

This only occurs the first time the terminal fills up and you can simply
'fg' the debugger back to the foreground and it will continue without
any problems.  You can also work around it by doing 'set height 0' in
gdb as this prevents it from prompting when the terminal fills up.

I couldn't find any bugs regarding this in the database, only an
unanswered message in a mailing list somewhere.  Has anyone else seen
this before?  It is a bug isn't it?  Is there a better fix/workaround so
that I can keep my value for height untouched and not have to 'fg' the
debugger?

I've seen this with gdb 6.2 and 6.3, I compiled the example below with
gcc 3.2.3 and it occurs with both bash and tcsh.  I've only tested it
under RHEL3 & 4.

To see it for yourselves run this in GDB:
#include <unistd.h>

int main()
{
    while(1)
    {
        if (!fork())
            exit(1);

        sleep(1);
    }
}


Cheers,
Craig.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]