From: Marian Posteuca <posteuca@gm...> - 2013-09-27 20:02:19
I have a problem when trying to debug a IMX6 CPU. The connection with
the cpu is established correctly and I can halt and resume the target.
The problems I'm having is to step through the code in GDB and to modify
register values. The strange thing is that both stepping and modifying
registry values from the telnet connection is working correctly.
In order to see what is the difference between telnet connection and GDB
connection I took the latest code version from git and compiled it
myself. I observed from debugging openocd that when I issue the telnet
command step, openocd sets a hardware breakpoint, but when I step from
GDB, openocd sets a software breakpoint. I modified the code in
gdb_breakpoint_watchpoint_packet() so as type would always be BKPT_HARD,
and after that I managed to single step from GDB.
I also have a problem when modifying a register, in GDB I modify the
register with set $r4=0 and I check with info registers to see the new
value. GDB shows that the value has modified, but after I resume the
target and halt it again( I have a while(1) loop which does nothing) I
see that value has not really changed. In telnet if I issue reg r4 0 the
value is changed with no problem. I also tried to debug this issue but I
did not find any major differences between the telnet code and the GDB one.
So does anyone know what could be the problem?