On 5 May 2011 09:23, Ben Leslie <be...@benno.id.au> wrote: > FWIW, the reason why I'm not using -kernel is that the current > way the armv7m code works, it expects the provided kernel to > be a full flash image including appropriate vector table, whereas > right now I just want to debug some stand-alone code, not the full > system, which the above gdb approach works perfectly for.
It would probably be better for the -kernel option to honour the entry point in the ELF file rather than insisting on full reset (and to try to load the reset SP from the vector table but not insist on that working). That is, we should support both "load this ELF image which is a full system image with a vector table" and "load this ELF image which is just a bare-metal (possibly semihosting) application". The combination of v7M reset with image loading and the possibility of a debugger altering the pc/sp while the core is in reset is a bit complicated, though :-) As an aside: I think QEMU should have an option which is "just load a plain ELF or raw binary, with no funny Linux-kernel-specific behaviour" rather than overloading -kernel to mean "if it's a raw image it's Linux and if it's an ELF file it's not". -- PMM