Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <Michael.Snyder@palmsource.com>
To: s88 <dave.tw@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: the breakpoint of gdb
Date: Fri, 13 Oct 2006 19:05:00 -0000	[thread overview]
Message-ID: <1160766220.14535.259.camel@localhost.localdomain> (raw)
In-Reply-To: <c9d32f760610131053h329664ecudcd3c69485698aae@mail.gmail.com>

On Sat, 2006-10-14 at 01:53 +0800, s88 wrote:
> Hi all:
> 
> Could anyone tell me something about how the gdb to achieve the the
> breakpoint function in different platform?

Thru a platform_specific method (function pointer) called
"target_insert_breakpoint".  Each target or platform defines
this function as appropriate.

Look for "target_insert_breakpoint" in breakpoint.c and target.h, 
then grep for "to_insert_breakpoint" in *.c.

> I heard the gdb's breakpoint implement on the X86 platform is by the
> instruction patch. It sounds interesting!! I want to know more
> details.

Yes, the most common method is to insert a trap instruction
(or similar) into memory.  See function "memory_insert_breakpoint"
in mem-break.c.  Again, each target platform has to define the
appropriate bit-pattern or instruction to be inserted.


> Any reference info, web page, books are welcome.

Hah.  If you write that book, you will become famous.   ;-)



  reply	other threads:[~2006-10-13 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13 17:53 s88
2006-10-13 19:05 ` Michael Snyder [this message]
2006-10-13 19:37 ` ramana.radhakrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1160766220.14535.259.camel@localhost.localdomain \
    --to=michael.snyder@palmsource.com \
    --cc=dave.tw@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox