From: Paul F. <fer...@gm...> - 2017-05-23 07:54:56
|
Hi! On Tue, May 23, 2017 at 08:33:04AM +0200, Ladislav Laska wrote: > I could dump memory, save registers and be done with it, but I doubt I > can load all of that back into gdb to be as useful as before, ispecting > stack, objects and current variables. Something I was puzzled about myself few weeks ago, and I came to the conclusion there's no working solution yet. You can probably write a core file generator based on the memory dump plus register contents, I haven't investigated this option but it's likely not prohibitively hard. Alternatively, you can later connect to the same target (live), replace all of its memory and registers and this way I think the state will be replicated enough for inspection. > I didn't find them in the gdb repository, but they seem to have been > merged, or at least not rejected. Looks like they were merged indeed, but what they actually do is quering remote's gdbserver process to read /proc/<pid>/maps via fileio extension. So basically they assume gdbserver running on Linux to work. > I wonder if there is some support necessary from openocd? Or is there > some way that openocd could generate a core file by itself? You can probably imitate reading of the /proc/<pid>/maps file, heh. There already exists some FileIO code so you should be able to repurpose it. Sorry about not having a ready-made solution for you. In case you're fighting some faults, this might come useful for Cortex-M3 targets, but with some modifications it should be applicable to Cortex-M0 too: https://github.com/karlp/zypsnips/blob/master/armv7m-vecstate-zippe.gdb HTH -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |