CHILD_FOLLOW_FORK.
* hppah-nat.c (saved_vfork_pid): Add.
(child_post_follow_vfork): Remove.
(child_follow_fork): New function.
(child_wait): Call detach_breakpoints after receiving the child vfork.
Call child_resume directly instead of going through resume ().
Make sure we have the exec before reporting the vfork.
* inferior.h (follow_inferior_reset_breakpoints): Add prototype.
* infrun.c (follow_fork, follow_vfork, follow_inferior_fork): Remove.
(follow_fork): New function. Call target_follow_fork.
(follow_inferior_reset_breakpoints): New function broken out from
old follow_inferior_fork.
(resume): Remove hack to follow exec after vfork.
* inftarg.c (child_post_follow_vfork): Remove.
(child_follow_fork): New function.
(init_child_ops): Replace to_post_follow_vfork with to_follow_fork.
* target.c (cleanup_target): Replace to_post_follow_vfork with
to_follow_fork.
(update_current_target): Likewise.
(setup_target_debug): Likewise.
(debug_to_post_follow_vfork): Remove.
(debug_to_follow_fork): New function.
* target.h (struct target_ops): Replace to_post_folow_vfork with
to_follow_fork.
(child_post_follow_vfork): Remove prototype.
(child_follow_fork): Add prototype.
(target_post_follow_vfork): Remove macro.
(target_follow_fork): Add macro.
testsuite/
* gdb.base/foll-vfork.exp: Re-enable test on HP/UX.
for the parent's fork event.
* infrun.c (handle_inferior_event): Only expect one fork event.
Call prepare_to_wait for TARGET_WAITKIND_IGNORE. Update comment.
* target.h: Update comment for TARGET_WAITKIND_IGNORE.
to_insert_watchpoint, to_remove_watchpoint,
to_stopped_by_watchpoint, to_stopped_data_address,
to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint to
target vecctor. Define their corresponding macros so they call
them.
* target.c: Add default and debug versions of for
to_insert_hw_breakpoint, to_remove_hw_breakpoint,
to_insert_watchpoint, to_remove_watchpoint,
to_stopped_by_watchpoint, to_stopped_data_address,
to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint.
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.
* 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.
* solib.c (current_sos): New function, replacing find_solib.
(find_solib): Deleted.
(free_so): New function.
(clear_solib): Call free_so, instead of writing it out.
(solib_add): Rewritten: compare the inferior's current list of
shared objects with GDB's list, and do the required loads and
unloads.
(info_sharedlibrary_command, solib_address): Don't use find_solib
to walk the list of shared libraries: call solib_add, and then
walk the list at so_list_head normally.
* objfiles.c (free_objfile): Don't call CLEAR_SOLIB, and don't
detach the core target. These tasks are taken care of elsewhere.
* target.c (remove_target_sections): New function.
* target.h (remove_target_sections): New declaration.
* solib.c (symbol_add_stub): Check whether we've already created
an objfile for this shared object first, before doing all that
work to compute section addresses, etc.
* objfiles.c (unlink_objfile): Report an internal error if objfile
doesn't occur in the object_files list.
* solib.c (special_symbol_handling): Delete argument; it's not
used.
* solib.c (SOLIB_EXTRACT_ADDRESS): New macro to extract addresses
from solib structures. Use it throughout solib.c, get rid of all
CORE_ADDR casts.
(struct so_list): Change type of lmaddr to CORE_ADDR.
(first_link_map_member): Change return value type to CORE_ADDR,
update callers.
(solib_add_common_symbols): Change parameter type to CORE_ADDR,
update callers.
(open_symbol_file_object, find_solib): Change type of lm variable
to CORE_ADDR.