From: Paul F. <fer...@gm...> - 2017-01-26 10:01:19
|
Hey Anton, On Thu, Jan 26, 2017 at 10:18:11AM +0100, Anton Gerasimov wrote: > I'm trying to debug SKEAZ128 (Kinetis EA MCU, based on Cortex-M0) > with gdb and OpenOCD over SWD. It kind of works, but for some reason > register values don't get into GDB. That is, I can write "monitor > reg pc" and see the actual program counter, but "info registers" > gives me outdated values, e.g. pc is stuck at reset handler > address. Of cource lack of info about PC and SP makes debugging > experience very constrained. Any ideas about what could be possibly > causing this? I'm not sure the problem is not in GDB of course. The explanation is simple: every time you type a "monitor" (or "mon") command, you're doing something behind GDB's back. So try to minimise the amount of such interactions. In this specific case, you can use GDB's command "set $pc = XXX" and then "stepi" (or "si") to single-step debug the target. Or you should avoid GDB altogether and use OpenOCD's telnet interface (with "reg", "step" and other OpenOCD's commands). If you really have to mix the two, then you need to bring GDB in sync by doing this sequence: "mon gdb_sync", then "si". The latter won't actually step the target but will make GDB refetch registers' contents from OpenOCD. HTH -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |