From owner-freebsd-hackers Mon Oct 29 15:22:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from web14005.mail.yahoo.com (web14005.mail.yahoo.com [216.136.175.121]) by hub.freebsd.org (Postfix) with SMTP id 8D5C837B405 for ; Mon, 29 Oct 2001 15:22:45 -0800 (PST) Message-ID: <20011029232245.12082.qmail@web14005.mail.yahoo.com> Received: from [216.103.213.142] by web14005.mail.yahoo.com via HTTP; Mon, 29 Oct 2001 15:22:45 PST Date: Mon, 29 Oct 2001 15:22:45 -0800 (PST) From: k Macy Subject: Re: problems with recurring SIGTRAP under gdb To: Ian Dowse Cc: freebsd-hackers@freebsd.org In-Reply-To: <200110291230.aa64062@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG SIGIO is used, but only for AIO and at this point no aio_* calls have been made. The loop for reading from STDIN may be a problem but I don't see how - this same loop is used without problems on Linux, OSF, and Solaris (although on Linux if you press Ctrl-C in gdb it often won't let you continue): int sim_getc(char *cp) { int r; sk_wait_for_fd(0); r = read(0, cp, 1); if (r <= 0) { dbg_printf("pccons_getchar: read failed: %s\n", error_msg()); sk_panic("pccons_getchar: failed read on stdin"); } return r; } sk_wait_for_fd is just: void sk_wait_for_fd(int fd) { int slot; sk_Msg *msg; if (sk_poll_one_fd(fd)>0) { /* fd is already ready */ return; } slot = sk_add_poll_fd(fd); if(slot < 0) return; do { msg = sk_receive(); if((msg->type == SK_SIGNAL_MSG) && (msg->data.l == HARD_SIG_00010)) break; } while (1); sk_remove_poll_fd(slot); } beneath this it just uses poll --- Ian Dowse wrote: > In message > <20011029023746.94559.qmail@web14001.mail.yahoo.com>, > k Macy writes: > >Any idea why when I insert a breakpoint I get a > >SIGTRAP > >and can't continue any further? Is this a bug in > the > > I've seen this on applications that use SIGIO on > stdin. If this is the > case, a workaround is to disable the SIGIO signal > while using the > debugger, e.g: > > (gdb) set $oldsigio = signal(23, (void *)1) > > The signal handler can be put back later with: > > call signal(23, (void *)$oldsigio) > > Ian __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message