* 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.
gdb/doc/
* gdb.texinfo (Memory Access Checking): New.
* memattr.h: Include "vec.h".
(struct mem_region): Remove linked list pointer.
(mem_region_s): New typedef and corresponding vector.
* memattr.c: Include "vec.h".
(mem_region_chain): Delete.
(mem_region_list): New vector pointer.
(mem_region_lessthan): New function.
(create_mem_region): Remove unused return value. Use vector
operations. Remove linear search.
(delete_mem_region): Delete.
(lookup_mem_region): Use vector operations. Add a FIXME.
(mem_info_command): Update to work with vectors.
(mem_enable, mem_enable_command, mem_disable, mem_disable_command)
(mem_free, mem_delete): Likewise.
`enable' and `disable' identifiers, because some platforms define
in their system headers symbols with global scope that go by those
names.
* breakpoint.h (enum enable_state): Rename from `enum enable'.
Also rename all the enum members to have the "bp_" prefix.
(struct breakpoint): Rename the `enable' member to `enable_state'.
(enum bpdisp): Rename all members to have the "disp_" prefix.
* breakpoint.c: All users of `enum enable' and `enum bpdisp'
changed.
(args_for_catchpoint_enable): Rename the `enable' member to
`enable_p'. All users changed.
* tracepoint.h (enum enable): Remove.
(struct tracepoint): The member `enabled' is now `int enabled_p'.
* tracepoint.c: All users of the `enabled' member changed.
* printcmd.c (struct display): The `status' member is now an int.
* memattr.h (struct mem_region): Rename the `status' member to
`enabled_p'.
(enum enable): Remove.
* memattr.c: Change all users of the `status' member of struct
mem_region to use `enabled_p' instead.
* infcmd.c (run_stack_dummy): Use disp_del instead of del.
* go32-nat.c: Remove the kludgey work-around for conflicts between
<dos.h> and "breakpoint.h".
* tui/tuiSourceWin.c: Use disp_del instead of del.
* tui/tuiSource.c: Use disp_del instead of del.
* tui/tuiDisassem.c: Use disp_del instead of del.
* infptrace.c (child_xfer_memory): Likewise.
* monitor.c (monitor_xfer_memory): Likewise.
* remote-adapt.c (adapt_xfer_inferior_memory): Likewise.
* remote-array.c (array_xfer_memory): Likewise.
* remote-bug.c (bug_xfer_memory): Likewise.
* remote-e7000.c (e7000_xfer_inferior_memory): Likewise.
* remote-eb.c (eb_xfer_inferior_memory): Likewise.
* remote-es.c (es1800_xfer_inferior_memory): Likewise.
* remote-mips.c (mips_xfer_memory): Likewise.
* remote-mm.c (mm_xfer_inferior_memory): Likewise.
* remote-nindy.c (nindy_xfer_inferior_memory): Likewise.
* remote-os9k.c (rombug_xfer_inferior_memory): Likewise.
* remote-rdi.c (arm_rdi_xfer_memory): Likewise.
* remote-rdp.c (remote_rdp_xfer_inferior_memory): Likewise.
* remote-sds.c (sds_xfer_memory): Likewise.
* remote-sim.c (gdbsim_xfer_inferior_memory): Likewise.
* remote-st.c (st2000_xfer_inferior_memory): Likewise.
* remote-udi.c (udi_xfer_inferior_memory): Likewise.
* remote-vx.c (vx_xfer_memory): Likewise.
* remote.c (remote_xfer_memory): Likewise.
* target.c (debug_to_xfer_memory, do_xfer_memory): Likewise.
* target.h (child_xfer_memory, do_xfer_memory, xfer_memory): Likewise.
* target.h (#include "memattr.h"): Added.
(target_ops.to_xfer_memory): Add attrib argument.
* wince.c (_initialize_inftarg): Removed call to set_dcache_state.
* dcache.h (set_dcache_state): Removed declaration.
* dcache.c (set_dcache_state): Removed definition
* dcache.c: Update module comment, as dcache is now enabled and
disabled with memory region attributes instead of by the global
variable "remotecache". Add comment describing the interaction
between dcache and memory region attributes.
(dcache_xfer_memory): Add comment describing benefits of moving
cache writeback to a higher level.
(dcache_struct): Removed cache_has_stuff field. This was used to
record whether the cache had been accessed in order to invalidate
it when it was disabled. However, this is not needed because the
cache is write through and the code that enables, disables, and
deletes memory regions invalidate the cache. Add comment which
suggests that we could be more selective and only invalidate those
cache lines containing data from those memory regions.
(dcache_invalidate): Updated.
(dcache_xfer_memory): Updated.
(dcache_alloc): Don't abort() if dcache_enabled_p is clear.
(dcache_xfer_memory): Removed code that called do_xfer_memory() to
perform a uncached transfer if dcache_enabled_p was clear. This
function is now only called if caching is enabled for the memory
region.
(dcache_info): Always print cache info.
* target.c (do_xfer_memory): Add attrib argument.
(target_xfer_memory, target_xfer_memory_partial): Break transfer
into chunks defined by memory regions, pass region attributes to
do_xfer_memory().
* dcache.c (dcache_read_line, dcache_write_line): Likewise.
* Makefile.in (SFILES): Add memattr.c.
(COMMON_OBS): Add memattr.o.
(dcache.o): Add target.h to dependencies.
* memattr.c: New file.
* memattr.h: Likewise.