On Thu, Jan 14, 2010 at 4:05 PM, Spencer Oliver <s...@spen-soft.co.uk> wrote:
> Øyvind Harboe wrote:
>>>
>>> I am a bit bemused by this.
>>> GDB will have a good copy of the registers when it connects to openocd
>>> anyway.
>>
>> Not necessarily true:
>>
>> target remote
>> load
>> monitor reg xxxx
>> => GDB is out of sync
>> stepi
>> => gdb is in sync here.
>>
>>
>
> but surely the regs should be saved/restored by openocd during the gdb load?

The problem is that openocd or the target state can change
behind GDB's back.

E.g. if you power cycle the target while connected to GDB,
or hotplug.

There are  *raft* of issues and I don't recall them all. Basically
the assumption that OpenOCD, GDB and the target are in
sync is seriously flawed on all levels. Especially for hardware
type debugging like openocd.

E.g. now connecting with to GDB is a no-operation. It does not
affect the target state. This means that it is possible to connect
to GDB and issue GDB monitor commands to bring the target
into the "correct" state before GDB starts talking to it.

The target could be running or halted during GDB connect.

The stepi synchronizes GDB to the target stage, i.e. if the
target was running while GDB was connected, stepi will not
return until the target halts.

I posted several messages on the gdb_sync issues, here's one:

http://lists.berlios.de/pipermail/openocd-development/2009-September/010779.html

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to