Sun Nov 9 14:18:19 EST 2014
fixing p main()
It tries to set a breakpoint:
Here 0x8002150 is the reset handler.
Why does it pick that particular address?
It doesn't seem to depend on the original $pc.
The 'Z' packet is used for breakpoints. It tries this first:
So let's implement it.
Ok, done. No more writing software breakpoints.
So why reset vector? Maybe it is totally arbitrary?
Need to look at what it sets:
This corresponds to:
lr 0x080021cd 134226381
sp 0xfffffff8 0xfffffff8
pc 0x080011f0 0x80011f0 <main>
cpsr 0x01000000 16777216
bp+1 == lr (lsb is thumb mode)
It seems that the BP location really doesn't matter.
It reserves 2 words on the current stack frame. Original sp = 0;
What about cpsr?