Return zeros when GDB reads just past end of stack.
authorSami Liedes <sliedes@cc.hut.fi>
Wed, 2 Feb 2011 20:18:04 +0000 (22:18 +0200)
committerSami Liedes <sliedes@cc.hut.fi>
Wed, 2 Feb 2011 20:53:38 +0000 (22:53 +0200)
commit8c526abb7d8c2a0bacddf38a0c187738a6c0bf9a
treeb7cd318c446db683c16e1c0ee822ae67863761ad
parent248a15167a3d116da59b493dbd381706b5dd5370
Return zeros when GDB reads just past end of stack.

GDB likes to read the topmost value of stack when using the
"stepi" (step instruction) command. Unfortunately this does not work
when the stack is empty, causing an error message and GDB confusion.

Hack the GDB stub code to just return zeros if GDB tries to read two
bytes just past the end of stack.

NOTE: This may need to be modified to support also longer reads for
bigger AVRs where code pointers are longer than two bytes (e.g.
ATMega2560). As simavr doesn't support atm2560 yet, I'm implementing
it this way now.
simavr/sim/sim_gdb.c