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.
* inferior.h (registers_info, stepi_command, nexti_command,
continue_command, interrupt_target_command): Export from infcmd.c.
* frame.h (args_info, selected_frame_level_changed_hook,
return_command): Export from stack.c.
* v850ice.c (stepi_command, nexti_command, continue_command): use
prototypes from inferior.h.
* tracepoint.c (registers_info, args_info, locals_info): Use
prototypes from frame.h and inferior.h.
* Makefile.in (mi-main.o): Add dependency on frame.h.
2002-10-02 Elena Zannoni <ezannoni@redhat.com>
* mi-main.c (mi_cmd_exec_return): Don't use
return_command_wrapper, use return_command instead.
(mi_cmd_exec_interrupt): Don't use
interrupt_target_command_wrapper, use interrupt_target_command
instead.
(return_command_wrapper, interrupt_target_command_wrapper):
Delete.
Include frame.h.
2002-10-02 Elena Zannoni <ezannoni@redhat.com>
* tui-hooks.c (selected_frame_level_changed_hook): Use the one
exported from frame.h.
deprecated_grub_regcache_for_registers.
* values.c: Include "regcache.h".
(value_being_returned): Update. Use
deprecated_grub_regcache_for_registers to extract the register
buffer address.
* value.h (value_being_returned): Change ``retbuf'' parameter to a
``struct regcache''.
* Makefile.in (values.o): Add dependency on $(regcache_h).
* inferior.h (run_stack_dummy): Change type of second parameter to
a ``struct regcache''.
* valops.c (hand_function_call): Change type of retbuf to ``struct
regcache''. Allocate using regcache_xmalloc, clean using
make_cleanup_regcache_xfree.
* infcmd.c (run_stack_dummy): Update. Use
regcache_cpu_no_passthrough instead of memcpy to copy the buffer.
* regcache.c (do_regcache_xfree): New function.
(make_cleanup_regcache_xfree): New function.
* regcache.h (make_cleanup_regcache_xfree): Declare.
regcache'''.
(xmalloc_inferior_status): Delete function.
(free_inferior_status): Delete function.
(normal_stop): Use regcache_cpy.
(struct inferior_status): Change type of fields ``stop_registers''
and ``registers'' to ``struct regcache''.
(write_inferior_status_register): Use regcache_write.
(save_inferior_status): Instead of calling
xmalloc_inferior_status, allocate the inf_status buffer directly.
Use regcache_dup_no_passthrough and regcache_dup to save the
buffers.
(restore_inferior_status): Use regcache_xfree and regcache_cpy.
Replace the stop_registers regcache instead of overriding it. Use
regcache_xfree. Instead of calling free_inferior_status, xfree
the buffer directly.
(discard_inferior_status): Use regcache_xfree. Instead of calling
free_inferior_status, xfree the buffer directly.
(build_infrun): Use regcache_xmalloc.
(_initialize_infrun): Delete redundant call to build_infrun.
* Makefile.in (infcmd.o): Add $(regcache_h).
* infcmd.c: Include "regcache.h".
(run_stack_dummy): Use deprecated_grub_regcache_for_registers to
obtain the address of `stop_registers' register buffer.
(print_return_value): Ditto.
* inferior.h (struct regcache): Add opaque declaration.
(stop_registers): Change variable's declared type to ``struct
regcache''.
* dwarf2cfi.c (cfi_write_fp): Document as not used.
* mips-tdep.c (mips_gdbarch_init): Do not set write_fp.
* ia64-tdep.c (ia64_gdbarch_init): Do not set write_fp.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set write_fp.
* rs6000-tdep.c (rs6000_gdbarch_init): Do not set write_fp.
* s390-tdep.c (s390_gdbarch_init): Do not set write_fp.
(s390_write_fp):
* sh-tdep.c (sh_gdbarch_init): Do not set write_fp.
* x86-64-tdep.c (i386_gdbarch_init): Do not set write_fp.
* d10v-tdep.c (d10v_gdbarch_init): Do not set write_fp.
(d10v_write_fp): Delete function.
* inferior.h (write_fp, generic_target_write_fp): Delete
declarations.
* regcache.c (generic_target_write_fp): Delete function.
(write_fp): Delete function.
* gdbarch.sh (TARGET_WRITE_FP): Delete.
* gdbarch.h, gdbarch.c: Regenerate.
* config/v850/tm-v850.h (TARGET_WRITE_FP): Delete macro.
* config/sparc/tm-sp64.h (TARGET_WRITE_FP): Delete macro.
(sparc64_write_fp): Delete declaration.
* config/h8500/tm-h8500.h (TARGET_WRITE_FP): Delete macro.
(h8500_write_fp): Delete declaration.
* arch-utils.c (default_prepare_to_proceed)
(generic_prepare_to_proceed): Added new functions.
* arch-utils.h: New function declarations for
default_prepare_to_proceed() and generic_prepare_to_proceed().
* gdbarch.sh: Added PREPARE_TO_PROCEED.
* gdbarch.c: Regenerated.
* gdbarch.h: Regenerated.
* inferior.h: Added get_last_target_status() declaration.
* infrun.c (get_last_target_status): Added new function.
(handle_inferior_event): Saves last pid and waitstatus, which will
get returned by get_last_target_status().
* hppa-tdep.c (prepare_to_proceed): Added comment stating that
prepare_to_proceed() is potentially redundant since
default_prepare_to_proceed() has been added.
* linux-thread.c (prepare_to_proceed): Ditto.
* lin-lwp.c (prepare_to_proceed): Ditto.
* m3-nat.c (prepare_to_proceed): Ditto.
From David Deephanphongs <deephan@telocity.com>
* inferior.h: Fix declarations of get_inferior_args and
set_inferior_args, which were missing the trailing 's'.
* infcmd.c (get_inferior_args, set_inferior_args): Accessor functions
for the inferior program arguments.
(run_command, run_no_args_command, init_infcmd)): Use accessor
functions to set the inferior program arguments.
* inferior.h: Add definitions to the accessor functions above.
step_over_calls.
* infcmd.c (step_over_calls): Change definition.
(step_1): Use new enum values in relation to step_over_calls.
(step_once): Ditto.
(until_next_command): Ditto.
* infrun.c (clear_proceed_status): Ditto.
(handle_inferior_event): Ditto.
* inferior.h (step_stop_if_no_debug): New variable.
* infrun.c (step_stop_if_no_debug): Declare.
(handle_inferior_event): Stop the step command if we entered a function without
line info.
(_initialize_infrun): New command 'set step-mode' to control the step command.
* infcmd.c (step_once): Switch to stepi mode if there is no line info
(and switching is enabled).
* regcache.c (registers_changed, registers_fetched): Use
ARCH_NUM_REGS directly, eliminating an unnecessary variable.
This change adds pseudo-register capability to GDB.
Pseudo-registers are handled like registers, but they
don't come from or live on the target. They may be
aliases for an existing register, or they may be computed.
* defs.h (NUM_PSEUDO_REGISTERS): Define default of zero.
(ARCH_FETCH_PSEUDO_REGISTERS): Define default of no-op.
(ARCH_STORE_PSEUDO_REGISTERS): Define default of no-op.
# regcache.c (registers_changed): Mark pseudo-registers
invalid, as well as real registers.
(registers_fetched): Do not mark pseudo-registers as fetched
at the same time as other (real) registers.
(read_register_bytes): Fetch pseudo-registers (if any) from
the target architecture module instead of from the target.
(read_register_gen): Ditto.
(read_register): Ditto.
(write_register_bytes): Store pseudo-registers (if any) to
the target architecture module instead of to the target.
(write_register_gen): Ditto.
(write_register): Ditto.
(build_regcache): Allocate enough register_valid space for
pseudo-registers as well as normal (real) ones.
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.