Hi,
I would like to set a breakpoint in gdb when memory address is accessed using this command:
(gdb) rwatch *0xde400000
Hardware read watchpoint 1: *0xde400000
When I run the program I get this error:
(gdb) r
Starting program: /root/console
Unexpected error setting breakpoint: Invalid argument.
I think the system is capable of handling one hw watchpoint:
(gdb) show can-use-hw-watchpoints
Debugger's willingness to use watchpoint hardware is 1.
But I don't understand why can't I use it!
My gdb is version 7.5.1 and I'm using LTIB
Any ideas?
Tarek, please click Correct Answer/Helpful Answer if your question has been answered.
Thanks,
Yixing
Hi,
I already check GDB sources and found this error is only throw in two places at two different source files.
The two conditions only check a variable which copies the break point register from the ARM cpu.
The conditions are:
if (arm_hwbp_control_is_initialized (proc_info->bpts[i].control))
if (!arm_hwbp_control_is_enabled (bpts[i].control))
and the files are :
./gdb/arm-linux-nat.c
./gdb/gdbserver/linux-arm-low.c
When the error happens the issue throw a message "Unexpected error setting breakpoint" and attach a string generated from the erno variable the error in this case is
EINVAL (Invalid argument). Which is a generic error, that error should be throw by the kernel and the source could be one of many.
In order to know which error is throwing the EINVAL you should debug the kernel in this source file:
arch/arm/kernel/hw_breakpoint.c
http://lxr.free-electrons.com/source/arch/arm/kernel/hw_breakpoint.c
Regards,
-Israel.