public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Implementation of different software breakpoint kinds in gdb server
@ 2012-10-18  9:23 Michal Lesniewski
  2012-10-18 10:08 ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Lesniewski @ 2012-10-18  9:23 UTC (permalink / raw)
  To: gdb

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


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

end of thread, other threads:[~2012-10-19  8:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18  9:23 Implementation of different software breakpoint kinds in gdb server Michal Lesniewski
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

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).