This commit applies all changes made after running the gdb/copyright.py
script.
Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.
gdb/ChangeLog:
Update copyright year range in all GDB files.
This patch removes VEC (mem_region). Doing so requires touching a lot
of little things here and there.
The fields in mem_attrib are now initialized during construction. The
values match those that were in default_mem_attrib (now removed).
unknown_mem_attrib is also removed, and replaced with a static method
(mem_attrib::unknown) that returns the equivalent.
mem_region is initialized in a way similar to mem_region_init (now
removed) did.
I found the organization of mem_region_list and target_mem_region_list a
bit confusing. Sometimes mem_region_list points to the same vector as
target_mem_region_list (and therefore does not own it), and sometimes
(when the user manually edits the mem regions) points to another vector,
and in this case owns it. To avoid this ambiguity, I think it is
simpler to have two vectors, one for target-defined regions and one for
user-defined regions, and have mem_region_list point to one or the
other. There are now no vector objects dynamically allocated, both are
static.
The make-target-delegates script does not generate valid code when a
target method returns a type with a parameter list. For this reason, I
created a typedef (mem_region_vector) that's only used in the target_ops
structure. If you speak perl, you are welcome to improve the script!
Regtested on the buildbot.
gdb/ChangeLog:
* memattr.h: Don't include vec.h.
(struct mem_attrib): Initialize fields.
<unknown>: New static method.
(struct mem_region): Add constructors, operator<, initialize
fields.
* memattr.c: Include algorithm.
(default_mem_attrib, unknown_mem_attrib): Remove.
(user_mem_region_list): New global.
(target_mem_region_list, mem_region_list): Change type to
std::vector<mem_region>.
(mem_use_target): Now a function.
(target_mem_regions_valid): Change type to bool.
(mem_region_lessthan, mem_region_cmp, mem_region_init): Remove.
(require_user_regions): Adjust.
(require_target_regions): Adjust.
(create_mem_region): Adjust.
(lookup_mem_region): Adjust.
(invalidate_target_mem_regions): Adjust.
(mem_clear): Rename to...
(user_mem_clear): ... this, and adjust.
(mem_command): Adjust.
(info_mem_command): Adjust.
(mem_enable, enable_mem_command, mem_disable,
disable_mem_command): Adjust.
(mem_delete): Adjust.
(delete_mem_command): Adjust.
* memory-map.h (parse_memory_map): Return an std::vector.
* memory-map.c (parse_memory_map): Likewise.
(struct memory_map_parsing_data): Add constructor.
<memory_map>: Point to std::vector.
(memory_map_start_memory): Adjust.
(memory_map_end_memory): Adjust.
(memory_map_end_property): Adjust.
(clear_result): Remove.
* remote.c (remote_memory_map): Return an std::vector.
* target-debug.h (target_debug_print_VEC_mem_region_s__p):
Remove.
(target_debug_print_mem_region_vector): New.
* target-delegates.c: Regenerate.
* target.h (mem_region_vector): New typedef.
(to_memory_map): Return mem_region_vector.
(target_memory_map): Return an std::vector.
* target.c (target_memory_map): Return an std::vector.
(flash_erase_command): Adjust.
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.
gdb/ChangeLog:
Update copyright year range in all GDB files.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
* 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.