From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9875 invoked by alias); 5 Aug 2004 00:24:55 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 9857 invoked from network); 5 Aug 2004 00:24:54 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 5 Aug 2004 00:24:54 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i750Ose3027632 for ; Wed, 4 Aug 2004 20:24:54 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i750Ona32189; Wed, 4 Aug 2004 20:24:49 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 07EA22B9D; Wed, 4 Aug 2004 20:24:43 -0400 (EDT) Message-ID: <41117E4A.1040502@gnu.org> Date: Thu, 05 Aug 2004 00:24:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040801 MIME-Version: 1.0 To: Qing Zhang Cc: gdb@sources.redhat.com Subject: Re: pausing gdb References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00057.txt.bz2 > Hi, > > Can anyone tell me how ctrl-c is handled in gdb? More importantly how > is gdb able to continue from a sigint. > > your help is much appreciated. I'm assuming this is UNIX. Check the man pages for ptrace, and wait. The sequence, assuming that GDB's attached to the process (aka inferior): - GDB's blocked on wait() ; inferior process running - user enters CNTRL-C - kernel, instead of delivering cntrl-c to inferior process, unblocks GDB returning a ``SIGINT'' indication for that wait() call - GDB interacts with user - user enters "continue" - gdb does ptrace (continue) - kernel resumes inferior process (signal is never delivered) Andrew