From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10957 invoked by alias); 6 Feb 2009 15:14:34 -0000 Received: (qmail 10946 invoked by uid 22791); 6 Feb 2009 15:14:34 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Feb 2009 15:14:29 +0000 Received: by rv-out-0708.google.com with SMTP id b17so783815rvf.48 for ; Fri, 06 Feb 2009 07:14:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.248.15 with SMTP id v15mr1311489rvh.295.1233933267019; Fri, 06 Feb 2009 07:14:27 -0800 (PST) In-Reply-To: References: <308806.32791.qm@web36206.mail.mud.yahoo.com> Date: Fri, 06 Feb 2009 15:14:00 -0000 Message-ID: Subject: Re: What happened in gdb between handle_sigint and async_request_quit? From: "Amker.Cheng" To: gdb@sourceware.org Cc: paawan1982@yahoo.com, teawater Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00064.txt.bz2 Hi : I think I've got the truth about what happened when CTRL+C is hit during debugging. both of GDB and Debuggee will get the event. Windows will report DBG_CONTROL_C exception to GDB, which was turned into TARGET_SIGNAL_INT in GDB. According to MSDN, this is the First Chance Exception! Now the debugee is stopped and GDB got informed. After I input the "continue" command . Because the default action is nopass for SIGINT, GDB will just resume debuggee using function ContinueDebugEvent() with the second argument set to DBG_CONTINUE, which stops all exception processing and continues the thread(debuggee). That's why debuggee will not get the CTRL+C event. To be accurate, the debuggee has received the CTRL+C event, just bypassed by OS violently. Again, if I let GDB pass SIGINT to debuggee using command "handle 2 pass", GDB will call function ContinueDebugEvent() with the second argument set to DBG_EXCEPTION_NOT_HANDLED, which cause debuggee to continues the exception processing(for this is a first-chance exception event). Now I think it clear enough as how GDB handles SIGINT is concerned, am I right? Although there are other puzzles such as the "quit_flag", etc.. Thanks for your time Regards.