This patch makes gdb, when target memory map is available, optionally reject all memory accesses outside of regions in memory map. The rationale is that: 1. It's sometimes better to get error that have the write silently do nothing or read returning garbase. 2. For some targets, accesses to non-existent memory "wedge" them. Since memory maps are still rare, this behaviour is enabled only by a new command. OK? - Volodya * memattr.h (enum mem_access_mode): New value MEM_NONE. * memattr.c (unknown_mem_attrib): New. (inaccessible_by_default): New. (show_inaccessible_by_default): New. (lookup_mem_region): Check inaccessible_by_default. (dummy_cmd): New. (mem_set_cmdlist, mem_show_cmdlist): New. (_initialize_mem): Register new "set" and "show" commands. * target.c (memory_xfer_partial): If memory type is MEM_NONE, return an error. Clip to region size when calling to_xfer_partial. If upper limit of memory range is 0, don't clip anything.