public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Why gdb/gdbserver handler breakpoint on gdb client side (ARM)?
@ 2015-06-25  1:22 Fei Ding
  2015-06-25 13:50 ` Paul_Koning
  0 siblings, 1 reply; 2+ messages in thread
From: Fei Ding @ 2015-06-25  1:22 UTC (permalink / raw)
  To: gdb

Hi.

Recently I am working on debugging a bug of gdb/gdbserver when setting
breakpoints on ARM devices. I found that, gdb-client nearly do nothing
about it when we use gdb/gdbserver on x86 platform, gdbserver do the
dirty work in fact, including generate INT 3 instruction, read, save,
and write memory, etc... But for ARM, this work is done on the
gdb-client side, which is opposed to x86 case. Anyone know why? Or any
thoughts?

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why gdb/gdbserver handler breakpoint on gdb client side (ARM)?
  2015-06-25  1:22 Why gdb/gdbserver handler breakpoint on gdb client side (ARM)? Fei Ding
@ 2015-06-25 13:50 ` Paul_Koning
  0 siblings, 0 replies; 2+ messages in thread
From: Paul_Koning @ 2015-06-25 13:50 UTC (permalink / raw)
  To: fdingiit; +Cc: gdb


> On Jun 24, 2015, at 9:22 PM, Fei Ding <fdingiit@gmail.com> wrote:
> 
> Hi.
> 
> Recently I am working on debugging a bug of gdb/gdbserver when setting
> breakpoints on ARM devices. I found that, gdb-client nearly do nothing
> about it when we use gdb/gdbserver on x86 platform, gdbserver do the
> dirty work in fact, including generate INT 3 instruction, read, save,
> and write memory, etc... But for ARM, this work is done on the
> gdb-client side, which is opposed to x86 case. Anyone know why? Or any
> thoughts?

Some targets have a “hardware breakpoint” or “software breakpoint” feature where the hardware or OS implements breakpoint support directly.  Others don’t.  If they don’t, then GDB just does the work by saving the original instruction, replacing it by a break, restoring the original when the breakpoint is hit, and so on.

Both work.  Why does it matter which approach is used?

	paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-25 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25  1:22 Why gdb/gdbserver handler breakpoint on gdb client side (ARM)? Fei Ding
2015-06-25 13:50 ` Paul_Koning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).