i.MX6Q: gdb rwatch error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX6Q: gdb rwatch error

1,036件の閲覧回数
Tarek
Senior Contributor I

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?

ラベル(2)
0 件の賞賛
返信
2 返答(返信)

814件の閲覧回数
YixingKong
Senior Contributor IV

Tarek, please click Correct Answer/Helpful Answer if your question has been answered.

Thanks,

Yixing

0 件の賞賛
返信

814件の閲覧回数
israelpz
Senior Contributor I

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.

Errors: Linux System Errors

errno(3) - Linux manual page

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.