GDB watchpoint ( HW breakpoint )

553 views
Skip to first unread message

Marius Cirsta

unread,
Dec 28, 2014, 3:47:31 PM12/28/14
to andro...@googlegroups.com
 I'm trying to set a breakpoint on a memory value to see when that value is being read. I believe GDB calls this a data breakpoint or a watchpoint. From what I've read so far this requires a hardware breakpoint.

 I saw support for a HW breakpoint being added to gdbserver in 2011 and support for it in the kernel was added earlier. 

 When I tried to add a such a data breakpoint from GDB, which was connected to the remote gdbsever ( 7.6 from the latest NDK ) it failed with a message which leads me to believe that it failed to set a hardware breakpoint.

Any ideas on this ? Is setting a HW breakpoint supported in Android ( using the gdbsever and gdb from the latest NDK ) ? How can I check if it's enabled or available, does the kernel need any specific configuration for this ?

Thanks.

T mac

unread,
Jan 4, 2015, 2:45:26 PM1/4/15
to andro...@googlegroups.com
This is something I've also been looking into, the only thing I've found that might be of use is the kernel config flag CONFIG_HAVE_HW_BREAKPOINT 
I haven't had a chance to compile my own kernel with this but probably worth a try.

Ryan Bissell

unread,
May 3, 2015, 9:08:34 PM5/3/15
to andro...@googlegroups.com
Marius,

Was your target device running on a 32-bit ARM CPU?  If so: it is my experience that production 32-bit ARM devices have HW watchpoints disabled. (By 'production', I mean devices commercially available at retail outlets.  On the other hand, development kits-- sold to developers by the ARM CPU manufacturers-- may still have these features enabled.  I am not positive, but I think this may be recommended practice by ARM.)

However, it seems that this may be different for aarch64 CPUs.   (I can successfully hit HW watchpoints on Nexus 9, for instance.)

</ryan>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages