public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdbserver: variable sized breakpoints
@ 2011-07-07  2:14 Mike Frysinger
  2011-07-07  3:13 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2011-07-07  2:14 UTC (permalink / raw)
  To: gdb; +Cc: toolchain-devel

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

current Blackfin cpus have an oddity where the insn being turned into a 
software breakpoint has to be of an equal size.  our break point insn is 
16bits long, so replacing a 16bit insn works fine.  but replacing a 32bit insn 
requires us to use the 16bit bp insn followed by a 16bit nop.  failure to do 
this can result in the unreplaced 16bits triggering undesirable side effects 
as it can be an invalid insn, one that causes speculative fetches, etc...

gdb itself takes care of this when it's setting breakpoints in 
bfin_breakpoint_from_pc.  but gdbserver doesnt seem to have a way to handle 
this.  is it already possible ?  or does the linux_target_ops struct need to 
be extended ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: gdbserver: variable sized breakpoints
  2011-07-07  2:14 gdbserver: variable sized breakpoints Mike Frysinger
@ 2011-07-07  3:13 ` Yao Qi
  2011-07-07 19:58   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2011-07-07  3:13 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb, toolchain-devel

On 07/07/2011 10:13 AM, Mike Frysinger wrote:

> gdb itself takes care of this when it's setting breakpoints in 
> bfin_breakpoint_from_pc.  but gdbserver doesnt seem to have a way to handle 
> this.  is it already possible ?  or does the linux_target_ops struct need to 
> be extended ?

gdbserver doesn't have to worry about this.  gdb is able to send
breakpoint insn by 'M' packet, IIRC, if remote stub doesn't support 'Z0'
packet.  Looks target->insert_point is not defined in bfin gdbserver, so
'Z0' packet is not supported.  Then, gdb can send the right breakpoint
insn (32-bit or 16-bit) by 'M' packet to remote.

-- 
Yao (齐尧)

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

* Re: gdbserver: variable sized breakpoints
  2011-07-07  3:13 ` Yao Qi
@ 2011-07-07 19:58   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2011-07-07 19:58 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb, toolchain-devel

On Wed, Jul 6, 2011 at 23:13, Yao Qi wrote:
> On 07/07/2011 10:13 AM, Mike Frysinger wrote:
>> gdb itself takes care of this when it's setting breakpoints in
>> bfin_breakpoint_from_pc.  but gdbserver doesnt seem to have a way to handle
>> this.  is it already possible ?  or does the linux_target_ops struct need to
>> be extended ?
>
> gdbserver doesn't have to worry about this.  gdb is able to send
> breakpoint insn by 'M' packet, IIRC, if remote stub doesn't support 'Z0'
> packet.  Looks target->insert_point is not defined in bfin gdbserver, so
> 'Z0' packet is not supported.  Then, gdb can send the right breakpoint
> insn (32-bit or 16-bit) by 'M' packet to remote.

thanks, this sounds like it should work fine for us then as long as
the linux-low code doesnt change :).

in looking at the particular bug we're seeing atm, it seems it's due
to putting the 16bit insn in the 2nd half of the 32bit insn (after not
being able to detect the function prolog) and thus creating a
completely different 32bit insn.  so something is off, but it's not
this issue.
-mike

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

end of thread, other threads:[~2011-07-07 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07  2:14 gdbserver: variable sized breakpoints Mike Frysinger
2011-07-07  3:13 ` Yao Qi
2011-07-07 19:58   ` Mike Frysinger

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