If you stop the target you should store the target context into the local register cache and if you resume the target you need to restore the context. This is why the target registers never read again if the target already halted.
Am 02.05.2011 18:22, schrieb Jie Zhang: > Thank you for your reply! > > I'm adding a new target to OpenOCD. But I think all existing targets in > OpenOCD have this issue. > Maybe I missed something... > > Jie > > On Mon, May 2, 2011 at 12:13 PM, Mathias K. <[email protected] > <mailto:[email protected]>> wrote: > > Hello, > > please tell us more about your target platform. > > > Regards, > > Mathias > > Am 02.05.2011 18:06, schrieb Jie Zhang: > > Hi, > > > > I encountered an issue when using OpenOCD with GDB. After GDB connects > to OpenOCD and halt the > > target, "info reg" command returns all zeros for all registers. I took > a look at the related code > > and found that when GDB requests register values from OpenOCD, OpenOCD > does not read register from > > target, instead it just calls target_get_gdb_reg_list to create a > register list without > initializing > > it with real register value, and then just returns them to GDB. Is it a > bug or by design? > > > > Regards, > > Jie > > > > > > > > _______________________________________________ > > Openocd-development mailing list > > [email protected] > <mailto:[email protected]> > > https://lists.berlios.de/mailman/listinfo/openocd-development > > _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
