[<<][arm][>>][..]
Sun Nov 9 14:18:19 EST 2014

fixing p main()

It tries to set a breakpoint:

$m8002150,2#2b
+$0023#c5
+
$X8002150,2:..#cc
+$Efd#0f
+


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:

$Z0,8002154,2#78
+$#00

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:

$Pe=cd210008#e4
+$OK#9a
+
$Pd=f8ffffff#f3
+$OK#9a
+
$Pf=f0110008#b3
+$OK#9a
+
$P19=00000001#78
+$OK#9a
+
$Z0,80021cc,2#d5
+$OK#9a
+

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?



[1] https://sourceware.org/gdb/onlinedocs/gdb/Calling.html



[Reply][About]
[<<][arm][>>][..]