Closed
Bug 1035645
Opened 11 years ago
Closed 11 years ago
[Flame] Enable gdb hardware watchpoint
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(b2g-v2.0 fixed, b2g-v2.1 fixed)
RESOLVED
FIXED
2.0 S6 (18july)
People
(Reporter: ting, Assigned: ting)
Details
Attachments
(1 file)
Tried to enable gdb hardware watchpoint on Flame by the steps at [1], but gdb is not stopped when the address is written by the program, rwatch works fine though. The results are the same on both linarno 7.6.1-2013.10 [2] and jimdb 7.5 [3].
[1] https://intranet.mozilla.org/B2G_Team/Unagi#Alternatively_building_your_own_Unagi_kernel
[2] https://releases.linaro.org/13.10/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2
[3] http://people.mozilla.org/~nchen/jimdb/jimdb-arm-linux_x64.tar.bz2
| Assignee | ||
Updated•11 years ago
|
QA Contact: tchou
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → tchou
QA Contact: tchou
| Assignee | ||
Comment 1•11 years ago
|
||
Even it is the instruction "str r2, [r3, #0]" triggers do_DataAbort(), the bit WnR of DFSR is not set, which fails the access type checking below and return from watchpoint_handler():
access = (fsr & ARM_FSR_ACCESS_MASK) ? HW_BREAKPOINT_W : HW_BREAKPOINT_R;
if (!(access & hw_breakpoint_type(wp)))
goto unlock;
This causes infinite do_DataAbort(), and gdb is never stopped. But if you interrupt gdb and continue several times, you should see $pc is not changing.
There is a patch for this [1], watch works ok after applying it. There's another patch [2] also worths merging.
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bf8801145c01ab600f8df66e8c879ac642fa5846
[2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d968d2b801d877601d54e35e6dd0f52d9c797c99
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8452204 -
Flags: review?(mwu)
| Assignee | ||
Comment 3•11 years ago
|
||
Here are the steps I used to enable HW watchpoint:
1. Enable HAVE_HW_BREAKPOINT by modifying kernel/arch/arm/Kconfig:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9dd7949..04f3b99 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -29,7 +29,8 @@ config ARM
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
- select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
+# select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
+ select HAVE_HW_BREAKPOINT
select HAVE_C_RECORDMCOUNT
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
2. Replace prebuilts/misc/android-arm/gdbserver/gdbserver by linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/arm-linux-gnueabihf/debug-root/usr/bin/gdbserver.
3. $ ./build.sh && ./flash.sh
4. $ export GDB=linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gdb
$ ./run-gdb.sh
Updated•11 years ago
|
Attachment #8452204 -
Flags: review?(mwu) → review+
Comment 4•11 years ago
|
||
CCing m1 in case he is interested in getting hardware watchpoints working.
Comment 6•11 years ago
|
||
t2m-flame-3.4-jb: https://github.com/mozilla-b2g/codeaurora_kernel_msm/commit/30d40a5636ff28a554f1d8e9d975bfd04c2463d3
Status: NEW → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S6 (18july)
Comment 7•11 years ago
|
||
(In reply to Michael Wu [:mwu] from comment #4)
> CCing m1 in case he is interested in getting hardware watchpoints working.
Cool, thanks for the heads up
Updated•11 years ago
|
status-b2g-v2.0:
--- → fixed
status-b2g-v2.1:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•