From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3441 invoked by alias); 19 Aug 2009 21:09:27 -0000 Received: (qmail 3432 invoked by uid 22791); 19 Aug 2009 21:09:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Aug 2009 21:09:19 +0000 Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 29F591C15834; Wed, 19 Aug 2009 23:09:16 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id 13B9290140; Wed, 19 Aug 2009 23:09:16 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id 2M19yAem2IF1; Wed, 19 Aug 2009 23:09:15 +0200 (CEST) Received: from igel.home (DSL01.83.171.156.199.ip-pool.NEFkom.net [83.171.156.199]) by mail.mnet-online.de (Postfix) with ESMTP; Wed, 19 Aug 2009 23:09:14 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 29C6710C4A8; Wed, 19 Aug 2009 23:09:13 +0200 (CEST) From: Andreas Schwab To: kceiwH Cc: gdb@sourceware.org Subject: Re: How GDB knows a breakpoint is hit? References: <84D22DD1-F4AD-4985-A0EC-AF3B53774D10@gmail.com> X-Yow: Of course, you UNDERSTAND about the PLAIDS in the SPIN CYCLE -- Date: Wed, 19 Aug 2009 22:11:00 -0000 In-Reply-To: <84D22DD1-F4AD-4985-A0EC-AF3B53774D10@gmail.com> (kceiwh@gmail.com's message of "Wed, 19 Aug 2009 11:28:17 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-08/txt/msg00184.txt.bz2 kceiwH writes: > I wonder how GDB knows it should stop the inferior when a breakpoint is > hit. I try to read the code but only to find how GDB creates a > breakpoint. I thought GDB might change some instructions of inferior so > that when the inferior executes the modified instructions, GDB should > know. But what the function "create_breakpoint" does is to add a > breakpoint to the list "breakpoint_chain". Breakpoints are only inserted immediately before the inferior is resumed, see insert_breakpoints. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."