Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* False positive permanent breakpoints
@ 2016-10-26 14:04 Ofir Cohen
  2016-10-26 14:28 ` Pedro Alves
  0 siblings, 1 reply; 7+ messages in thread
From: Ofir Cohen @ 2016-10-26 14:04 UTC (permalink / raw)
  To: gdb; +Cc: Ofir Cohen

Hello,
We have debugging support for code running on the iGPU, and we've encountered
something that looks like a limitation of gdb.

Problem: gdb freaks out on the iGPU when trying to step over/continue when
               stopped on a permanent breakpoint.

Root-cause: gdb *falsely* identifies some instructions as permanent breakpoints.


Details
======
We don't call set_gdbarch_skip_permanent_breakpoint() on our target, so there
is no support for stepping over permanent breakpoints. Which is fine
since software breakpoints is not something that we support at the
moment.

While trying to fix the root-cause,
i.e. let gdb determine that instruction is indeed a breakpoint instruction,
I ran into a wall.

Looks like gdb is being too *coarse* for the check (whether it is a
breakpoint instruction):
if (err || memcmp (buf, bp_opcode (bp), bp_size (bp)) != 0)

in validate_inserted_breakpoint() function.

I'm saying coarse here because on the iGPU the breakpoint thingy is mandated
by a single bit, and does not have a unique *opcode*.


Proposed solution
==============
Could we abstract (delegate away) this predicate to the _target_ ?

Perhaps setting a default handler for other targets.

Thanks,
Ofir


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

end of thread, other threads:[~2016-10-26 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 14:04 False positive permanent breakpoints Ofir Cohen
2016-10-26 14:28 ` Pedro Alves
2016-10-26 14:42   ` Ofir Cohen
2016-10-26 14:50     ` Pedro Alves
2016-10-26 15:02       ` Ofir Cohen
2016-10-26 15:14         ` Pedro Alves
2016-10-26 15:25           ` Ofir Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox