This is a fairly advanced question, perhaps for @zachary – though anyone with good knowledge of (ARM) GDB might be able to help.
I have set myself up with an ST-Link/V2 and st-util, on my OS X 10.9 system. I am able to live debug the Sparkcore’s bootloader.elf, using GDB, basically because it installs at memory offset zero.
However, I have not been able to figure out how to use GDB to debug core-firmware, apparently because it installs at memory offset 0x5000 and core-firmware.elf has no knowledge of the boot loader code, at offset zero.
EDIT: So, although setting breakpoints and the like seems to use the correct addresses, I think the system reset performed just before jumping to user firmware is messing things up, maybe? Or for that matter, I just realised that the JTAG interface is likely being disabled entirely. Hmmm.
See. I told you it was an advanced question.
EDIT: I understand that normally, only the boot loader contains the chip configuration boot code, for clock initialisation, etc and that it is told to install at memory offset zero by using linker script
linker_stm32f10x_md.ld instead of
linker_stm32f10x_md_dfu.ld. But that’s about as far as my current knowledge of all this goes.