More cleanup from import of readline 4.3.
* completer.h (complete_line, readline_line_completion_function):
Update prototypes.
(line_completion_function): Removed, not used outside of completer.c.
* completer.c (readline_line_completion_function,
complete_function, line_completion_function): Use const for first
parameter.
(line_completion_function): Make static.
(filename_completer): filename_completion_function is now called
rl_filename_completion_function
* corelow.c: Include <readline/readline.h>.
* exec.c: Ditto.
* solib.c: Ditto.
* source.c: Ditto.
* symfile.c: Ditto.
* symmisc.c: Ditto.
* top.c (init_main): No need to coerce
readline_line_completion_function anymore.
* cli/cli-dump.c: Include <readline/readline.h>.
* exec.c (xfer_memory): Replace boolean with int.
* p-exp.y: Use 0 instead of false.
* corelow.c (gdb_check_format): Change return type to int from
boolean.
* utils.c: Don't include <curses.h> or <term.h> first.
Implement a "generate-core-file" command in gdb, save target state.
* gcore.c: New file. Implement new command 'generate-core-file'.
Save a corefile image of the current state of the inferior.
* linux-proc.c: Add linux-specific code for saving corefiles.
* target.h (struct target_ops): Add new target vectors for saving
corefiles; to_find_memory_regions and to_make_corefile_notes.
(target_find_memory_regions): New macro.
(target_make_corefile_notes): New macro.
* target.c (update_current_target): Inherit new target methods.
(dummy_find_memory_regions): New place-holder method.
(dummy_make_corefile_notes): New place-holder method.
(init_dummy_target): Initialize new dummy target vectors.
* exec.c (exec_set_find_memory_regions): New function.
Allow the exec_ops vector for memory regions to be taken over.
(exec_make_note_section): New function, target vector method.
* defs.h (exec_set_find_memory_regions): Export prototype.
* procfs.c (proc_find_memory_regions): New function, corefile method.
(procfs_make_note_section): New function, corefile method.
(init_procfs_ops): Set new target vector pointers.
(find_memory_regions_callback): New function.
(procfs_do_thread_registers): New function.
(procfs_corefile_thread_callback): New function.
* sol-thread.c (sol_find_memory_regions): New function.
(sol_make_note_section): New function.
(init_sol_thread_ops): Initialize new target vectors.
* inftarg.c (inftarg_set_find_memory_regions): New function.
Allow to_find_memory_regions vector to be taken over.
(inftarg_set_make_corefile_notes): New function.
Allow to_make_corefile_notes vector to be taken over.
* thread-db.c (thread_db_new_objfile): Don't activate thread-db
interface layer if not target_has_execution (may be a corefile).
* config/i386/linux.mh: Add gcore.o to NATDEPFILES.
* config/sparc/sun4sol2.mh: Ditto.
* config/alpha/alpha-linux.mh: Ditto.
* config/arm/linux.mh: Ditto.
* config/i386/x86-64linux.mh: Ditto.
* config/ia64/linux.mh: Ditto.
* config/m68k/linux.mh: Ditto.
* config/mips/linux.mh: Ditto.
* config/powerpc/linux.mh: Ditto.
* config/sparc/linux.mh: Ditto.
Fix double parsing of filenames passed as command line arguments
to GDB (causes weird handling of escape characters).
Also, remove dependencies on the CLI from libgdb.
* call-cmds.h: Remove declaration of exec_file_command().
* gdbcore.h: Remove declaration of exec_file_command().
Add declarations for exec_open() and exec_file_clear().
* symfile.h: Add declarations for symbol_file_add_main() and
symbol_file_clear().
* exec.c (exec_open): New function. Implements to_open for exec
targets.
(exec_file_clear): New function. Makes GDB forget about a previously
specified executable file.
(exec_file_attach): Move parsing of arguments from here ...
(exec_file_command): ... to here.
(init_exec_ops): Use exec_open(), not exec_file_command() to
implement to_open for exec targets.
* symfile.c (symbol_file_add_main): New function. Call symbol_file_add() with default values. Used when the file name has already been parsed.
(symbol_file_clear): New function. Makes GDB forget about previously
read symbols.
(symbol_file_command): Call the above function instead of inline code.
* main.c: Include "symfile.h" and "gdbcore.h" instead of the deprecated
"call-cmds.h".
(captured_main): Call exec_file_attach() and symbol_file_add_main()
instead of exec_file_command() and symbol_file_command().
(captured_main): Add comment.
* corefile.c: Include "symfile.h".
(core_file_command): Call symbol_file_add_main() instead of
symbol_file_command().
(reopen_exec_file): Call exec_open() instead of exec_file_command().
* infcmd.c: Include "symfile.h".
(attach_command): Call symbol_file_add_main() instead of
symbol_file_command().
* infrun.c: Remove comment about the inclusion of "symfile.h",
not any longer appropriate.
(follow_exec): Call symbol_file_add_main() instead of
symbol_file_command().
* remote-es.c: Include "symfile.h".
(es1800_load): Call symbol_file_add_main() instead of
symbol_file_command().
* remote-vx.c: Remove comment about the inclusion of "symfile.h",
not any longer appropriate.
(vx-wait): Call symbol_file_add_main() instead of
symbol_file_command().
* solib-svr4.c (open_symbol_file_object): Call symbol_file_add_main()
instead of symbol_file_command().
* v850ice.c (ice_file): Call exec_open(), exec_file_attach() and
symbol_file_add_main() instead of exec_file_command() and
symbol_file_command().
* Makefile.in: Update dependencies.
* 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.
* linespec.h: New file. Declarations for linespec.c.
* linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c,
symtab.c, tracepoint.c: Include the above.
* completer.c: New file. Line completion stuff for GDB.
(get_gdb_completer_word_break_characters,
get_gdb_completer_quote_characters): New functions. Accessors for
useful completer internal data.
(filename_completer, line_completion_function, skip_quoted): Moved
here from top.c.
* completer.h: New file. Declarations for the above.
* linespec.c (decode_line_1): Use
get_gdb_completer_word_break_characters and
get_gdb_completer_quote_characters.
* top.c: Include completer.h.
(filename_completer, line_completion_function, skip_quoted):
Moved to completer.c.
* corefile.c, exec.c, source.c, symfile.c, linespec.c: Include
completer.h.
* Makefile.in (SFILES): Add completer.c.
(COMMON_OBS): Add completer.o.
(completer.o): New target.
(linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o,
symtab.o, tracepoint.o): Add linespec.h to dependencies list.
(corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h
to dependencies list.
There should be sufficient information/hooks now to eliminate
this hack.
* exec.c (file_command): Add a new hook here to inform ui's
when the exec file has changed. Adding it here allows the
ui to be informed after symbol reading.
* gdbcore.h: Add declaration of file_changed_hook.
* symfile.c (symfile_bfd_open):
* exec.c (exec_file_command): for __GO32__ and __WIN32__ systems,
free the user from having to type the .exe extension.
* Makefile.in: Remove xcoffexec.o rule.
* exec.c (exec_file_command): Add comment.
Fix data and bss relocation for VxWorks 5.1:
* remote-vx.c (vx_add_symbols): New function.
(vx_load_command, add_symbol_stub): Call it instead of
symbol_file_add.
(vx_wait): Remove comment which was wrong to useless.
* remote-vx.c: Reindent much of file.
* coffread.c (cs_to_section, find_targ_sec): New functions.
(process_coff_symbol): Set SYMBOL_SECTION to result
from cs_to_section.
(coff_symtab_read): Call cs_to_section and deal appropriate
rather than assuming sections are in a certain order. Deal with
BSS.
* coffread.c: Remove text_bfd_scnum variable.
(symfile.h, objfiles.h, xcoffsolib.h): Include.
(vmap): New global variable.
(exec_close): Close and free objects in vmap chain.
(exec_file_command) [IBM6000_TARGET]: Set up initial vmap.
(bfdsec_to_vmap, map_vmap): Moved here from xcoffexec.c.
(exec_files_info): Print vmap information.
* xcoffexec.c: Remove.
* config/rs6000/rs6000.mt, config/rs6000/rs6000lynx.mt
(TDEPFILES): Use exec.o instead of xcoffexec.o.
* TODO: Remove pertinent items.
(set_endian): Mention that ``auto'' is permitted.
(set_endian_auto): New static function.
(show_endian): Change message based on target_byte_order_auto.
(set_endian_from_file): New function.
(init_main): Add command ``auto'' to endianlist.
* exec.c (exec_file_command): Call set_endian_from_file.
* defs.h (set_endian_from_file): Declare.