This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How GDB knows a breakpoint is hit?
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: kceiwH <kceiwh at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 19 Aug 2009 23:09:13 +0200
- Subject: Re: How GDB knows a breakpoint is hit?
- References: <84D22DD1-F4AD-4985-A0EC-AF3B53774D10@gmail.com>
kceiwH <kceiwh@gmail.com> 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."