Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michal Lesniewski <m.lesniewski@samsung.com>
To: gdb@sourceware.org
Subject: Implementation of different software breakpoint kinds in gdb server
Date: Thu, 18 Oct 2012 09:23:00 -0000	[thread overview]
Message-ID: <000001cdad12$1e2b1950$5a814bf0$%lesniewski@samsung.com> (raw)

Hi All,

I have been recently analyzing parts of GDB server code. I focused mainly on
the ARM specific code and checked if it is possible to add tracepoint
support for this architecture. I found out that there is a lot of work to do
that but that's not the point. The main problem is the internal
implementation of software breakpoints. 

The most general type of tracepoints are trap tracepoints (created using the
trace command). These are implemented internally using software breakpoints.
Software breakpoints are set by simply overwriting the instruction, at which
the program should stop, by a trap instruction or illegal instruction. When
the processor reaches the instruction, a exception occurs and gdbserver
handles it. 

Now the problem is that gdbserver always uses the same trap/illegal
instruction code. The functions in mem-break.c do not provide any way to
allow using different kinds of trap instructions depending on some
additional parameters. On most architectures this is OK, but on ARM there
are two instruction sets - ARM (32 bit) and Thumb (mixed 16 and 32 bit).
Depending on the instruction set used at a specific address, the trap
instruction should be different. 

I was wondering if anybody was already considering to extend the code in
mem-break.c to add support for different kinds of breakpoints. 

Best Regards,
Michal Lesniewski



             reply	other threads:[~2012-10-18  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  9:23 Michal Lesniewski [this message]
2012-10-18 10:08 ` Pedro Alves
2012-10-18 10:28   ` Yao Qi
2012-10-18 10:42     ` Pedro Alves
2012-10-18 11:44   ` Michal Lesniewski
2012-10-18 12:01     ` Pedro Alves
2012-10-19  0:31       ` John Gilmore
2012-10-19  8:51         ` Michal Lesniewski

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='000001cdad12$1e2b1950$5a814bf0$%lesniewski@samsung.com' \
    --to=m.lesniewski@samsung.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