gdb_server: check for invalid read memory requests
This prevents invalid free(NULL) (that crashes OpenOCD on desktop
distros).
With radare2 it's now a bit more useful, memory access works if I seek
to the correct address, can't test further as it apparently lacks thumb2
support.
Change-Id: I6ec32d09fd52dab53ba765d7f7519baa1f55d973 Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1853 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>