Fix non-only rename list for Fortran modules import.
* cp-namespace.c (cp_scan_for_anonymous_namespaces): Adjust the
cp_add_using_directive caller.
(cp_add_using_directive): New parameter excludes, describe it. New
variables ix and param. Compare if also excludes match. Allocate NEW
with variable size, initialize EXCLUDES there.
(cp_lookup_symbol_imports): New variable excludep, test
current->EXCLUDES with it.
* cp-support.h: Include vec.h.
(struct using_direct): New field excludes, describe it.
(DEF_VEC_P (const_char_ptr)): New.
(cp_add_using_directive): New parameter excludes.
* defs.h (const_char_ptr): New typedef.
* dwarf2read.c (read_import_statement): New variables child_die,
excludes and cleanups, read in excludes.
(read_namespace): Adjust the cp_add_using_directive caller.
gdb/testsuite/
Fix non-only rename list for Fortran modules import.
* gdb.fortran/module.exp (print var_x, print var_y, print var_z): New
tests.
* gdb.fortran/module.f90 (module moduse): New.
(program module): use moduse, test var_x, var_y and var_z.
* mi/mi-main.c (mi_cmd_execute): Use cleanup from
prepare_execute_command.
* top.c (prepare_execute_command): Return cleanup.
(execute_command): Use cleanup from prepare_execute_command.
* top.h (prepare_execute_command): Change prototype to return
cleanup.
* defs.h (struct value): Add opaque declaration.
(make_cleanup_value_free_to_mark): Add prototype.
* utils.c (do_value_free_to_mark): New function.
(make_cleanup_value_free_to_mark): Likewise.
gdb/testsuite/
* gdb.python/py-function.exp: Test setting a value from a function
which executes a command.
Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
Implement support for PowerPC BookE ranged breakpoints.
gdb/
* NEWS: Mention support for ranged breakpoints on embedded PowerPC.
* breakpoint.h (struct bp_target_info) <length>: New member
variable.
(struct breakpoint_ops) <breakpoint_hit>: Take struct bp_location
instead of struct breakpoint as argument, and also add ASPACE
and BP_ADDR arguments. Update all callers.
(struct breakpoint_ops) <print_one_detail>: New method.
(struct breakpoint) <addr_string_range_end>: New member variable.
* breakpoint.c (breakpoint_location_address_match): Add function
prototype.
(insert_bp_location): Set bl->target_info.length.
(breakpoint_here_p): Call breakpoint_location_address_match.
(moribund_breakpoint_here_p): Likewise.
(regular_breakpoint_inserted_here_p): Likewise.
(breakpoint_thread_match): Likewise.
(bpstat_stop_status): Likewise.
(bpstat_check_location): Move call to
breakpoint_ops.breakpoint_hit to the top.
(print_one_breakpoint_location): Call
breakpoint_ops.print_one_detail if available.
(breakpoint_address_match_range): New function.
(breakpoint_location_address_match): Likewise.
(breakpoint_locations_match): Compare the length field of the
locations too.
(hw_breakpoint_used_count): Count resources used by all locations
in a breakpoint, and use breakpoint_ops.resources_needed if
available.
(breakpoint_hit_ranged_breakpoint): New function.
(resources_needed_ranged_breakpoint): Likewise.
(print_it_ranged_breakpoint): Likewise.
(print_one_ranged_breakpoint): Likewise.
(print_one_detail_ranged_breakpoint): Likewise.
(print_mention_ranged_breakpoint): Likewise.
(print_recreate_ranged_breakpoint): Likewise.
(ranged_breakpoint_ops): New structure.
(find_breakpoint_range_end): New function.
(break_range_command): Likewise.
(delete_breakpoint): Free addr_string_range_end.
(update_breakpoint_locations): Add SALS_END argument. Update
all callers. Calculate breakpoint length if a non-zero SALS_END
is given. Call breakpoint_locations_match instead of
breakpoint_address_match.
(reset_breakpoint): Find SaL of the end of the range if B is a
ranged breakpoint.
(_initialize_breakpoint): Register break-range command.
* defs.h (print_core_address): Add function prototype.
* ppc-linux-nat.c (ppc_linux_ranged_break_num_registers): New
function.
(ppc_linux_insert_hw_breakpoint): Support ranged breakpoints.
(ppc_linux_remove_hw_breakpoint): Likewise.
(_initialize_ppc_linux_nat): Initialize
to_ranged_break_num_registers.
* target.c (update_current_target): Add comment about
to_ranged_break_num_registers.
(target_ranged_break_num_registers): New function.
* target.h (struct target_ops) <to_ranged_break_num_registers>:
New method.
(target_ranged_break_num_registers): Add function prototype.
* ui-out.c (ui_out_field_core_addr): Move address-printing logic to ...
* utils.c (print_core_address): ... here.
gdb/doc/
* gdb.texinfo (PowerPC Embedded): Document ranged breakpoints.
* python/py-breakpoint.c (BPPY_REQUIRE_VALID): Check if bp is
NULL.
(BPPY_SET_REQUIRE_VALID): Ditto.
(bpnum_is_valid): Delete function.
(bppy_get_visibility): New function.
(bppy_new): Parse for, and validate internal keyword. Pass
internal keyword to breakpoint or watchpoint functions.
(build_bp_list): New function.
(gdbpy_breakpoints): Rewrite. Use build_bp_list and
iterate_over_breakpoints.
(gdbpy_breakpoint_created): Rewrite. Do not store breakpoints in a
look-aside vector.
(gdbpy_breakpoint_deleted): Rewrite, defer breakpoint management
to internal breakpoint chain.
* breakpoint.c (set_breakpoint_number): New function.
(breakpoint_1): Check if breakpoint number is more than zero.
(set_raw_breakpoint_without_location): Set py_bp_object to NULL.
(create_breakpoint_sal): Take a new parameter called internal.
Call set_breakpoint_number with internal parameter. Do not
mention internal breakpoints. All callers updated.
(create_breakpoint): Ditto.
(create_breakpoints_sal): Ditto.
(watch_command_1): Ditto.
(watch_command_wrapper): Take a new parameter called internal.
All callers updated.
(rwatch_command_wrapper): Ditto.
(awatch_command_wrapper): Ditto.
(save_breakpoints): Update breakpoint save condition check.
(iterate_over_breakpoints): New function.
* breakpoint.h: Add conditional python includes. Add py_bp_object
and comment to struct breakpoint. Update all callers.
* defs.h: Add PyObject definition for GDB builds without Python.
2010-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Breakpoints In Python): Document "internal"
parameter, and visible attribute.
2010-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.exp: Add internal watchpoint and
breakpoint tests.
Redirect also uiout and stdtarg{,err} in execute_command_to_string.
* cli-logging.c (struct saved_output_files) <targerr>: New.
(set_logging_redirect, pop_output_files, handle_redirections):
Redirect also gdb_stdtargerr.
* defs.h (struct ui_out, make_cleanup_ui_out_redirect_pop): New
declarations.
* event-top.c (gdb_setup_readline, gdb_disable_readline): Redirect
also gdb_stdtargerr.
* top.c (execute_command_to_string): Move make_cleanup_ui_file_delete
to the top. Redirect also gdb_stdlog, gdb_stdtarg and gdb_stdtargerr.
Use ui_out_redirect, register make_cleanup_ui_out_redirect_pop.
* tui/tui-io.c (tui_setup_io): Redirect also gdb_stdtargerr.
* utils.c (do_ui_out_redirect_pop, make_cleanup_ui_out_redirect_pop):
New functions.
gdb/testsuite/
* gdb.python/python.exp (set height 0, collect help from uiout)
(verify help to uiout): New tests.
Make core files the process_stratum.
* corefile.c (core_target): New variable.
(core_file_command): Remove variable t, use core_target.
* corelow.c (core_ops): Make it static.
(init_core_ops): Change to process_stratum. Initialize CORE_TARGET.
* defs.h (make_cleanup_unpush_target): New prototype.
* gdbarch.h: Regenerate.
* gdbarch.sh (core_pid_to_str): Remove core_stratum from its comment.
* gdbcore.h (core_target): New declaration.
* inf-ptrace.c (inf_ptrace_create_inferior, inf_ptrace_attach): New
variables ops_already_pushed and back_to. Use push_target,
make_cleanup_unpush_target and discard_cleanups calls.
* record.c (record_open): Replace core_stratum by a core_bfd check.
* target.c (target_is_pushed): New function.
(find_core_target): Remove.
* target.h (enum strata) <core_stratum>: Remove.
(target_is_pushed): New declaration.
(find_core_target): Remove declaration.
* tracepoint.c (init_tfile_ops) <to_stratum>: Remove comment.
* utils.c (do_unpush_target, make_cleanup_unpush_target): New functions.
gdb/doc/
Make core files the process_stratum.
* gdb.texinfo (Active Targets): Remove core_stratum. Include
record_stratum example.
gdb/testsuite/
Make core files the process_stratum.
* gdb.base/corefile.exp (run: load core again)
(run: sanity check we see the core file, run: with core)
(run: core file is cleared, attach: load core again)
(attach: sanity check we see the core file, attach: with core)
(attach: core file is cleared): New tests.
* gdb.base/coremaker.c (main): New parameters. Implement "sleep" argv.
Consolidate code for displaying per-command time and space statistics to avoid
duplication. Piggyback on cleanups so that statistics get printed even when
commands terminate as a result of an error.
Changelog
* gdb/defs.h (make_command_stats_cleanup): Declare.
(set_display_time): Declare.
(set_display_space): Declare.
* gdb/event-top.c (command_handler): Use make_command_stats_cleanup.
* gdb/main.c (display_time, display_space): Move definitions to utils.c.
(captured_main): Use make_command_stats_cleanup to get start-up
statistics.
Use set_display_time and set_display_space for processing OPT_STATISTICS
case.
* gdb/maint.c (maintenance_time_display): Use set_display_time.
(maintenance_space_display): Use set_display_space.
* gdb/top.c (execute_command): Remove obsolete 'maint time' code.
(command_loop): Use make_command_stats_cleanup.
* gdb/utils.c (struct cmd_stats): Structure for storing initial time
and space usage.
(display_time, display_space): Move definitions here from utils.c.
(set_display_time): New function.
(set_display_space): New function.
(make_command_stats_cleanup): New function.
(report_command_stats): New auxiliary function for
make_command_stats_cleanup.
* gdb/testsuite/gdb.gdb/selftest.exp: Adjust expected message for
capturing start-up runtime.
* acinclude.m4 (GDB_AC_DEFINE_RELOCATABLE): New function.
(GDB_AC_WITH_DIR): Call it.
* configure.ac: Define WITH_PYTHON_PATH if we can find the
python installation directory.
* config.in: Regenerate.
* configure: Regenerate.
* defs.h (python_libdir): Declare.
* main.c (python_libdir): Define.
(captured_main): Initialize python_libdir.
* python/python.c (_initialize_python): #ifdef WITH_PYTHON_PATH,
call Py_SetProgramName to make sure python can find its libraries
and modules.
* defs.h (read_command_lines, read_command_lines_1): New
parameters validator and closure.
* tracepoint.h (struct action_line): Remove.
* breakpoint.h (struct breakpoint): Remove the 'actions'
field.
* defs.h (enum command_control_type): New value
while_stepping_control.
(struct command_line): Add comments.
* breakpoint.c (breakoint_is_tracepoint): New.
(breakpoint_set_commands): For tracepoints,
verify the commands are permissible.
(check_tracepoint_commands): New.
(commands_command): Require that each new line is validated using
check_tracepoint_command, if we set commands for a tracepoint.
(create_tracepoint_from_upload): Likewise.
(print_one_breakpoint_location): Remove the code to print
actions specifically.
(tracepoint_save_command): Relay to print_command_lines.
* cli/cli-script.c (process_next_line): New parameters validator
and closure. Handle 'while-stepping'. Call validator if not null.
(read_command_lines, read_command_lines1): Likewise.
(recurse_read_control_structure): New parameters validator and
closure. Handle while_stepping_control.
(print_command_lines): Handle while-stepping.
(get_command_line, define_command, document_command): Adjust.
* remote.c (remote_download_tracepoint): Adjust.
* tracepoint.c (make_cleanup_free_actions, read_actions)
(free_actions, do_free_actions_cleanup): Remove.
(trace_actions_command): Use read_command_lines.
(validate_actionline): Use error in one place.
(encode_actions_1): New, extracted from...
(encode_actions): ...this. Also use cleanups for exception
safety.
(trace_dump_command): Adjust.
* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
it's tracepoint.
* defs.h (gdb_bfd_errmsg): New extern.
* exec.c (exec_file_attach): Change bfd_errmsg to
gdb_bfd_errmsg.
* utils.c (AMBIGUOUS_MESS1): New macro.
(AMBIGUOUS_MESS2): New macro.
(gdb_bfd_errmsg): New function.
prototypes.
* printcmd.c (print_address_symbolic): Take a gdbarch argument.
Pass it to build_address_symbolic. All callers updated.
(build_address_symbolic): Take a gdbarch argument. Use
gdbarch_addr_bits_remove for functions. All callers updated.
Stan Shebs <stan@codesourcery.com>
Add base multi-executable/process support to GDB.
gdb/
* Makefile.in (SFILES): Add progspace.c.
(COMMON_OBS): Add progspace.o.
* progspace.h: New.
* progspace.c: New.
* breakpoint.h (struct bp_target_info) <placed_address_space>: New
field.
(struct bp_location) <pspace>: New field.
(struct breakpoint) <pspace>: New field.
(bpstat_stop_status, breakpoint_here_p)
(moribund_breakpoint_here_p, breakpoint_inserted_here_p)
(regular_breakpoint_inserted_here_p)
(software_breakpoint_inserted_here_p, breakpoint_thread_match)
(set_default_breakpoint): Adjust prototypes.
(remove_breakpoints_pid, breakpoint_program_space_exit): Declare.
(insert_single_step_breakpoint, deprecated_insert_raw_breakpoint):
Adjust prototypes.
* breakpoint.c (executing_startup): Delete.
(default_breakpoint_sspace): New.
(breakpoint_restore_shadows): Skip if the address space doesn't
match.
(update_watchpoint): Record the frame's program space in the
breakpoint location.
(insert_bp_location): Record the address space in target_info.
Adjust to pass the symbol space to solib_name_from_address.
(breakpoint_program_space_exit): New.
(insert_breakpoint_locations): Switch the symbol space and thread
when inserting breakpoints. Don't insert breakpoints in a vfork
parent waiting for vfork done if we're not attached to the vfork
child.
(remove_breakpoints_pid): New.
(reattach_breakpoints): Switch to a thread of PID. Ignore
breakpoints of other symbol spaces.
(create_internal_breakpoint): Store the symbol space in the sal.
(create_longjmp_master_breakpoint): Iterate over all symbol
spaces.
(update_breakpoints_after_exec): Ignore breakpoints for other
symbol spaces.
(remove_breakpoint): Rename to ...
(remove_breakpoint_1): ... this. Pass the breakpoints symbol
space to solib_name_from_address.
(remove_breakpoint): New.
(mark_breakpoints_out): Ignore breakpoints from other symbol
spaces.
(breakpoint_init_inferior): Ditto.
(breakpoint_here_p): Add an address space argument and adjust to
use breakpoint_address_match.
(moribund_breakpoint_here_p): Ditto.
(regular_breakpoint_inserted_here_p): Ditto.
(breakpoint_inserted_here_p): Ditto.
(software_breakpoint_inserted_here_p): Ditto.
(breakpoint_thread_match): Ditto.
(bpstat_check_location): Ditto.
(bpstat_stop_status): Ditto.
(print_breakpoint_location): If there's a location to print,
switch the current symbol space.
(print_one_breakpoint_location): Add `allflag' argument.
(print_one_breakpoint): Ditto. Adjust.
(do_captured_breakpoint_query): Adjust.
(breakpoint_1): Adjust.
(breakpoint_has_pc): Also match the symbol space.
(describe_other_breakpoints): Add a symbol space argument and
adjust.
(set_default_breakpoint): Add a symbol space argument. Set
default_breakpoint_sspace.
(breakpoint_address_match): New.
(check_duplicates_for): Add an address space argument, and adjust.
(set_raw_breakpoint): Record the symbol space in the location and
in the breakpoint.
(set_longjmp_breakpoint): Skip longjmp master breakpoints from
other symbol spaces.
(remove_thread_event_breakpoints, remove_solib_event_breakpoints)
(disable_breakpoints_in_shlibs): Skip breakpoints from other
symbol spaces.
(disable_breakpoints_in_unloaded_shlib): Match symbol spaces.
(create_catchpoint): Set the symbol space in the sal.
(disable_breakpoints_before_startup): Skip breakpoints from other
symbol spaces. Set executing_startup in the current symbol space.
(enable_breakpoints_after_startup): Clear executing_startup in the
current symbol space. Skip breakpoints from other symbol spaces.
(clone_momentary_breakpoint): Also copy the symbol space.
(add_location_to_breakpoint): Set the location's symbol space.
(bp_loc_is_permanent): Switch thread and symbol space.
(create_breakpoint): Adjust.
(expand_line_sal_maybe): Expand comment to mention symbol spaces.
Switch thread and symbol space when reading memory.
(parse_breakpoint_sals): Set the symbol space in the sal.
(break_command_really): Ditto.
(skip_prologue_sal): Switch and space.
(resolve_sal_pc): Ditto.
(watch_command_1): Record the symbol space in the sal.
(create_ada_exception_breakpoint): Adjust.
(clear_command): Adjust. Match symbol spaces.
(update_global_location_list): Use breakpoint_address_match.
(breakpoint_re_set_one): Switch thread and space.
(breakpoint_re_set): Save symbol space.
(breakpoint_re_set_thread): Also reset the symbol space.
(deprecated_insert_raw_breakpoint): Add an address space argument.
Adjust.
(insert_single_step_breakpoint): Ditto.
(single_step_breakpoint_inserted_here_p): Ditto.
(clear_syscall_counts): New.
(_initialize_breakpoint): Install it as inferior_exit observer.
* exec.h: Include "progspace.h".
(exec_bfd, exec_bfd_mtime): New defines.
(exec_close): Declare.
* exec.c: Include "gdbthread.h" and "progspace.h".
(exec_bfd, exec_bfd_mtime, current_target_sections_1): Delete.
(using_exec_ops): New.
(exec_close_1): Rename to exec_close, and make public.
(exec_close): Rename to exec_close_1, and adjust all callers. Add
description. Remove target sections and close executables from
all program spaces.
(exec_file_attach): Add comment.
(add_target_sections): Check on `using_exec_ops' to check if the
target should be pushed.
(remove_target_sections): Only unpush the target if there are no
more target sections in any symbol space.
* gdbcore.h: Include "exec.h".
(exec_bfd, exec_bfd_mtime): Remove declarations.
* frame.h (get_frame_program_space, get_frame_address_space)
(frame_unwind_program_space): Declare.
* frame.c (struct frame_info) <pspace, aspace>: New fields.
(create_sentinel_frame): Add program space argument. Set the
pspace and aspace fields of the frame object.
(get_current_frame, create_new_frame): Adjust.
(get_frame_program_space): New.
(frame_unwind_program_space): New.
(get_frame_address_space): New.
* stack.c (print_frame_info): Adjust.
(print_frame): Use the frame's program space.
* gdbthread.h (any_live_thread_of_process): Declare.
* thread.c (any_live_thread_of_process): New.
(switch_to_thread): Switch the program space as well.
(restore_selected_frame): Don't warn if trying to restore frame
level 0.
* inferior.h: Include "progspace.h".
(detach_fork): Declare.
(struct inferior) <removable, aspace, pspace>
<vfork_parent, vfork_child, pending_detach>
<waiting_for_vfork_done>: New fields.
<terminal_info>: Remove field.
<data, num_data>: New fields.
(register_inferior_data, register_inferior_data_with_cleanup)
(clear_inferior_data, set_inferior_data, inferior_data): Declare.
(exit_inferior, exit_inferior_silent, exit_inferior_num_silent)
(inferior_appeared): Declare.
(find_inferior_pid): Typo.
(find_inferior_id, find_inferior_for_program_space): Declare.
(set_current_inferior, save_current_inferior, prune_inferiors)
(number_of_inferiors): Declare.
(inferior_list): Declare.
* inferior.c: Include "gdbcore.h" and "symfile.h".
(inferior_list): Make public.
(delete_inferior_1): Always delete thread silently.
(find_inferior_id): Make public.
(current_inferior_): New.
(current_inferior): Use it.
(set_current_inferior): New.
(restore_inferior): New.
(save_current_inferior): New.
(free_inferior): Free the per-inferior data.
(add_inferior_silent): Allocate per-inferior data.
Call inferior_appeared.
(delete_threads_of_inferior): New.
(delete_inferior_1): Adjust interface to take an inferior pointer.
(delete_inferior): Adjust.
(delete_inferior_silent): Adjust.
(exit_inferior_1): New.
(exit_inferior): New.
(exit_inferior_silent): New.
(exit_inferior_num_silent): New.
(detach_inferior): Adjust.
(inferior_appeared): New.
(discard_all_inferiors): Adjust.
(find_inferior_id): Make public. Assert pid is not zero.
(find_inferior_for_program_space): New.
(have_inferiors): Check if we have any inferior with pid not zero.
(have_live_inferiors): Go over all pushed targets looking for
process_stratum.
(prune_inferiors): New.
(number_of_inferiors): New.
(print_inferior): Add executable column. Print vfork parent/child
relationships.
(inferior_command): Adjust to cope with not running inferiors.
(remove_inferior_command): New.
(add_inferior_command): New.
(clone_inferior_command): New.
(struct inferior_data): New.
(struct inferior_data_registration): New.
(struct inferior_data_registry): New.
(inferior_data_registry): New.
(register_inferior_data_with_cleanup): New.
(register_inferior_data): New.
(inferior_alloc_data): New.
(inferior_free_data): New.
(clear_inferior_data): New.
(set_inferior_data): New.
(inferior_data): New.
(initialize_inferiors): New.
(_initialize_inferiors): Register "add-inferior",
"remove-inferior" and "clone-inferior" commands.
* objfiles.h: Include "progspace.h".
(struct objfile) <pspace>: New field.
(symfile_objfile, object_files): Don't declare.
(ALL_PSPACE_OBJFILES): New.
(ALL_PSPACE_OBJFILES_SAFE): New.
(ALL_OBJFILES, ALL_OBJFILES_SAFE): Adjust.
(ALL_PSPACE_SYMTABS): New.
(ALL_PRIMARY_SYMTABS): Adjust.
(ALL_PSPACE_PRIMARY_SYMTABS): New.
(ALL_PSYMTABS): Adjust.
(ALL_PSPACE_PSYMTABS): New.
* objfiles.c (object_files, symfile_objfile): Delete.
(struct objfile_sspace_info): New.
(objfiles_pspace_data): New.
(objfiles_pspace_data_cleanup): New.
(get_objfile_pspace_data): New.
(objfiles_changed_p): Delete.
(allocate_objfile): Set the objfile's program space. Adjust to
reference objfiles_changed_p in pspace data.
(free_objfile): Adjust to reference objfiles_changed_p in pspace
data.
(objfile_relocate): Ditto.
(update_section_map): Add pspace argument. Adjust to iterate over
objfiles in the passed in pspace.
(find_pc_section): Delete sections and num_sections statics.
Adjust to refer to program space's objfiles_changed_p. Adjust to
refer to sections and num_sections store in the objfile's pspace
data.
(objfiles_changed): Adjust to reference objfiles_changed_p in
pspace data.
(_initialize_objfiles): New.
* linespec.c (decode_all_digits, decode_dollar): Set the sal's
program space.
* source.c (current_source_pspace): New.
(get_current_source_symtab_and_line): Set the sal's program space.
(set_current_source_symtab_and_line): Set current_source_pspace.
(select_source_symtab): Ditto. Use ALL_OBJFILES.
(forget_cached_source_info): Iterate over all program spaces.
* symfile.c (clear_symtab_users): Adjust.
* symmisc.c (print_symbol_bcache_statistics): Iterate over all
program spaces.
(print_objfile_statistics): Ditto.
(maintenance_print_msymbols): Ditto.
(maintenance_print_objfiles): Ditto.
(maintenance_info_symtabs): Ditto.
(maintenance_info_psymtabs): Ditto.
* symtab.h (SYMTAB_PSPACE): New.
(struct symtab_and_line) <pspace>: New field.
* symtab.c (init_sal): Clear the sal's program space.
(find_pc_sect_symtab): Set the sal's program space. Switch thread
and space.
(append_expanded_sal): Add program space argument. Iterate over
all program spaces.
(expand_line_sal): Iterate over all program spaces. Switch
program space.
* target.h (enum target_waitkind) <TARGET_WAITKIND_VFORK_DONE>: New.
(struct target_ops) <to_thread_address_space>: New field.
(target_thread_address_space): Define.
* target.c (target_detach): Only remove breakpoints from the
inferior we're detaching.
(target_thread_address_space): New.
* defs.h (initialize_progspace): Declare.
* top.c (gdb_init): Call it.
* solist.h (struct so_list) <sspace>: New field.
* solib.h (struct program_space): Forward declare.
(solib_name_from_address): Adjust prototype.
* solib.c (so_list_head): Replace with a macro referencing the
program space.
(update_solib_list): Set the so's program space.
(solib_name_from_address): Add a program space argument and adjust.
* solib-svr4.c (struct svr4_info) <pid>: Delete field.
<interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low>
<interp_plt_sect_high>: New fields.
(svr4_info_p, svr4_info): Delete.
(solib_svr4_sspace_data): New.
(get_svr4_info): Rewrite.
(svr4_sspace_data_cleanup): New.
(open_symbol_file_object): Adjust.
(svr4_default_sos): Adjust.
(svr4_fetch_objfile_link_map): Adjust.
(interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low)
(interp_plt_sect_high): Delete.
(svr4_in_dynsym_resolve_code): Adjust.
(enable_break): Adjust.
(svr4_clear_solib): Revert bit that removed the svr4_info here,
and reinstate clearing debug_base, debug_loader_offset_p,
debug_loader_offset and debug_loader_name.
(_initialize_svr4_solib): Register solib_svr4_pspace_data. Don't
install an inferior_exit observer anymore.
* printcmd.c (struct display) <pspace>: New field.
(display_command): Set the display's sspace.
(do_one_display): Match the display's sspace.
(display_uses_solib_p): Ditto.
* linux-fork.c (detach_fork): Moved to infrun.c.
(_initialize_linux_fork): Moved "detach-on-fork" command to
infrun.c.
* infrun.c (detach_fork): Moved from linux-fork.c.
(proceed_after_vfork_done): New.
(handle_vfork_child_exec_or_exit): New.
(follow_exec_mode_replace, follow_exec_mode_keep)
(follow_exec_mode_names, follow_exec_mode_string)
(show_follow_exec_mode_string): New.
(follow_exec): New. Reinstate the mark_breakpoints_out call.
Remove shared libraries before attaching new executable. If user
wants to keep the inferior, keep it.
(displaced_step_fixup): Adjust to pass an address space to the
breakpoints module.
(resume): Ditto.
(clear_proceed_status): In all-stop mode, always clear the proceed
status of all threads.
(prepare_to_proceed): Adjust to pass an address space to the
breakpoints module.
(proceed): Ditto.
(adjust_pc_after_break): Ditto.
(handle_inferior_event): When handling a process exit, switch the
program space to the inferior's that had exited. Call
handle_vfork_child_exec_or_exit. Adjust to pass an address space
to the breakpoints module. In non-stop mode, when following a
fork and detach-fork is off, also resume the other branch. Handle
TARGET_WAITKIND_VFORK_DONE. Set the program space in sals.
(normal_stop): Prune inferiors.
(_initialize_infrun): Install the new "follow-exec-mode" command.
"detach-on-fork" moved here.
* regcache.h (get_regcache_aspace): Declare.
* regcache.c (struct regcache) <aspace>: New field.
(regcache_xmalloc): Clear the aspace.
(get_regcache_aspace): New.
(regcache_cpy): Copy the aspace field.
(regcache_cpy_no_passthrough): Ditto.
(get_thread_regcache): Fetch the thread's address space from the
target, and store it in the regcache.
* infcall.c (call_function_by_hand): Set the sal's pspace.
* arch-utils.c (default_has_shared_address_space): New.
* arch-utils.h (default_has_shared_address_space): Declare.
* gdbarch.sh (has_shared_address_space): New.
* gdbarch.h, gdbarch.c: Regenerate.
* linux-tdep.c: Include auxv.h, target.h, elf/common.h.
(linux_has_shared_address_space): New.
(_initialize_linux_tdep): Declare.
* arm-tdep.c (arm_software_single_step): Pass the frame's address
space to insert_single_step_breakpoint.
* arm-linux-tdep.c (arm_linux_software_single_step): Pass the
frame's pspace to breakpoint functions.
* cris-tdep.c (crisv32_single_step_through_delay): Ditto.
(cris_software_single_step): Ditto.
* mips-tdep.c (deal_with_atomic_sequence): Add frame argument.
Pass the frame's pspace to breakpoint functions.
(mips_software_single_step): Adjust.
(mips_single_step_through_delay): Adjust.
* rs6000-aix-tdep.c (rs6000_software_single_step): Adjust.
* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Adjust.
* solib-irix.c (enable_break): Adjust to pass the current frame's
address space to breakpoint functions.
* sparc-tdep.c (sparc_software_single_step): Ditto.
* spu-tdep.c (spu_software_single_step): Ditto.
* alpha-tdep.c (alpha_software_single_step): Ditto.
* record.c (record_wait): Adjust to pass an address space to the
breakpoints module.
* fork-child.c (fork_inferior): Set the new inferior's program and
address spaces.
* inf-ptrace.c (inf_ptrace_follow_fork): Copy the parent's program
and address spaces.
(inf_ptrace_attach): Set the inferior's program and address spaces.
* linux-nat.c: Include "solib.h".
(linux_child_follow_fork): Manage parent and child's program and
address spaces. Clone the parent's program space if necessary.
Don't wait for the vfork to be done here. Refuse to resume if
following the vfork parent while leaving the child stopped.
(resume_callback): Don't resume a vfork parent.
(linux_nat_resume): Also check for pending events in the
lp->waitstatus field.
(linux_handle_extended_wait): Report TARGET_WAITKIND_VFORK_DONE
events to the core.
(stop_wait_callback): Don't wait for SIGSTOP on vfork parents.
(cancel_breakpoint): Adjust.
* linux-thread-db.c (thread_db_wait): Don't remove thread event
breakpoints here.
(thread_db_mourn_inferior): Don't mark breakpoints out here.
Remove thread event breakpoints after mourning.
* corelow.c: Include progspace.h.
(core_open): Set the inferior's program and address spaces.
* remote.c (remote_add_inferior): Set the new inferior's program
and address spaces.
(remote_start_remote): Update address spaces.
(extended_remote_create_inferior_1): Don't init the thread list if
we already debugging other inferiors.
* darwin-nat.c (darwin_attach): Set the new inferior's program and
address spaces.
* gnu-nat.c (gnu_attach): Ditto.
* go32-nat.c (go32_create_inferior): Ditto.
* inf-ttrace.c (inf_ttrace_follow_fork, inf_ttrace_attach): Ditto.
* monitor.c (monitor_open): Ditto.
* nto-procfs.c (procfs_attach, procfs_create_inferior): Ditto.
* procfs.c (do_attach): Ditto.
* windows-nat.c (do_initial_windows_stuff): Ditto.
* inflow.c (inferior_process_group)
(terminal_init_inferior_with_pgrp, terminal_inferior,
(terminal_ours_1, inflow_inferior_exit, copy_terminal_info)
(child_terminal_info, new_tty_postfork, set_sigint_trap): Adjust
to use per-inferior data instead of inferior->terminal_info.
(inflow_inferior_data): New.
(inflow_new_inferior): Delete.
(inflow_inferior_data_cleanup): New.
(get_inflow_inferior_data): New.
* mi/mi-interp.c (mi_new_inferior): Rename to...
(mi_inferior_appeared): ... this.
(mi_interpreter_init): Adjust.
* tui/tui-disasm.c: Include "progspace.h".
(tui_set_disassem_content): Pass an address space to
breakpoint_here_p.
* NEWS: Mention multi-program debugging support. Mention new
commands "add-inferior", "clone-inferior", "remove-inferior",
"maint info program-spaces", and new option "set
follow-exec-mode".
2009-10-19 Pedro Alves <pedro@codesourcery.com>
Stan Shebs <stan@codesourcery.com>
gdb/doc/
* observer.texi (new_inferior): Rename to...
(inferior_appeared): ... this.
2009-10-19 Pedro Alves <pedro@codesourcery.com>
Stan Shebs <stan@codesourcery.com>
gdb/testsuite/
* gdb.base/foll-vfork.exp: Adjust to spell out "follow-fork".
* gdb.base/foll-exec.exp: Adjust to expect a process id before
"Executing new program".
* gdb.base/foll-fork.exp: Adjust to spell out "follow-fork".
* gdb.base/multi-forks.exp: Ditto. Adjust to the inferior being
left listed after having been killed.
* gdb.base/attach.exp: Adjust to spell out "symbol-file".
* gdb.base/maint.exp: Adjust test.
* Makefile.in (ALL_SUBDIRS): Add gdb.multi.
* gdb.multi/Makefile.in: New.
* gdb.multi/base.exp: New.
* gdb.multi/goodbye.c: New.
* gdb.multi/hangout.c: New.
* gdb.multi/hello.c: New.
* gdb.multi/bkpt-multi-exec.c: New.
* gdb.multi/bkpt-multi-exec.exp: New.
* gdb.multi/crashme.c: New.
2009-10-19 Pedro Alves <pedro@codesourcery.com>
Stan Shebs <stan@codesourcery.com>
gdb/doc/
* gdb.texinfo (Inferiors): Rename node to ...
(Inferiors and Programs): ... this. Mention running multiple
programs in the same debug session.
<info inferiors>: Mention the new 'Executable' column if "info
inferiors". Update examples. Document the "add-inferior",
"clone-inferior", "remove-inferior" and "maint info
program-spaces" commands.
(Process): Rename node to...
(Forks): ... this. Document "set|show follow-exec-mode".
(init_last_source_visited): Delete.
(directory_command): Do not clear last_source_visited. Call
forget_cached_source_info only if required.
(unset_substitute_path_command, set_substitute_path_command): Call
forget_cached_source_info.
* mi/mi-cmd-env.c (mi_cmd_env_dir): Do not call
init_last_source_visited.
* defs.h (init_last_source_visited): Delete declaration.
* defs.h (read_command_lines_1): Declare.
* cli/cli-script.c (read_next_line): Only return string,
do not process.
(process_next_line): New, extracted from read_next_line.
(recurse_read_control_structure): Take a function pointer to the
read function.
(get_command_line) Pass the read_next_line as reader function
into recurse_read_control_structure.
(read_command_lines_1): New, extracted from...
(read_command_lines): ...here.
Remove the PROT parameter from openp.
* source.c (openp): Remove the parameter PROT. Assertion check MODE.
defs.h (openp): Update the prototype.
Update all the openp callers.
2009-02-06 Jim Blandy <jimb@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
Vladimir Prus <vladimir@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
* defs.h (enum lval_type): New value: lval_computed.
* value.h (struct lval_funcs): New type.
(allocate_computed_value, value_computed_funcs)
(value_computed_closure): New declarations.
* value.c (struct value): Add a structure to the location union
for computed lvalues, containing 'funcs' and 'closure' members.
(allocate_computed_value, value_computed_funcs)
(value_computed_closure): New functions.
(value_free): For computed lvalues, call the closure's
'free_closure' function before freeing the value itself.
(value_copy): If we're copying an lval_computed value, call the
closure's 'copy_closure' function.
(set_value_component_location): If the original value is a
computed lvalue, then call the closure's 'copy_closure' function.
(value_of_internalvar): If an internal variable's value is a
computed lvalue, make retrieving its value produce an equivalent
computed lvalue.
* valops.c (value_fetch_lazy): Unlazy computed lvalues by calling
their read function.
(value_assign): Assign to computed lvalues by calling their write
function.
gdb/doc/
2009-02-06 Pedro Alves <pedro@codesourcery.com>
* gdbint.texinfo (Values): New chapter.
2008-11-27 Tristan Gingold <gingold@adacore.com>
* NEWS: Add entry for new native configuration: Darwin.
* configure.host: Add Darwin host.
* configure.tgt: Add Darwin target.
* defs.h (enum gdb_osabi): Add GDB_OSABI_DARWIN.
* osabi.c (gdb_osabi_names): Add name for Darwin abi.
* i386-darwin-nat.c: New file.
* i386-darwin-tdep.c: New file.
* machoread.c: New file.
* darwin-nat-info.c: New file.
* darwin-nat.c: New file.
* darwin-nat.h: New file.
* darwin.defs: New file.
* config/i386/darwin.mh: New file.
gdb/doc:
2008-11-27 Tristan Gingold <gingold@adacore.com>
* gdb.texinfo (Darwin): Document Darwin specific features.
(do_all_inferior_continuations)
(discard_all_inferior_continuations): Declare.
* utils.c (add_inferior_continuation)
(do_all_inferior_continuations)
(discard_all_inferior_continuations): New.
* inferior.h (struct inferior) <continuations>: New field.
* inferior.c (free_inferior): Discard all the inferior
continuations.
* inf-loop.c (inferior_event_handler): Do all current inferior
continuations.
* infcmd.c (attach_command): Register an inferior continuation
instead of a thread continuation.
* infrun.c (handle_inferior_event): If stop_soon is
STOP_QUIETLY_NO_SIGSTOP, also expect a TARGET_SIGNAL_0.
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* defs.h: Mention ptid_is_pid.
* inferior.h (ptid_is_pid): Declare.
* gdbthread.h (struct thread_info) <stop_requested>: New field.
(set_stop_requested): Declare.
* infcmd.c (interrupt_target_1): Call set_stop_requested.
* infrun.c (clear_proceed_status): Clear stop_requested.
(infrun_thread_stop_requested_callback,
infrun_thread_stop_requested): New.
(handle_inferior_event): If a TARGET_SIGNAL_TRAP is reported on a
thread that had an explicit stop request, pretend we got a
TARGET_SIGNAL_0. Always stop if the thread had an explicit stop
request.
(print_stop_reason): In the SIGNAL_RECEIVED case, if we're not
outputting to MI, and we got a TARGET_SIGNAL_0, print "# Stopped",
instead of mentioning signal 0.
(ptid_is_pid): New.
* thread.c (set_stop_requested): New.
* linux-nat.c (queued_waitpid): Rename to ...
(queued_waitpid_1): ... this. Add `peek' argument. Handle it.
(queued_waitpid): New, as wrapper to queued_waitpid_1.
(push_waitpid): Push the SIGTRAP to the local event queue, to the
kernel's.
(send_sigint_callback): Delete.
(linux_nat_stop_lwp): New.
(linux_nat_stop): Use it.
gdb/doc/
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* observer.texi (thread_stop_requested): New.
gdb/testsuite/
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* lib/mi-support.exp (mi_expect_interrupt): Expect signal 0
instead of SIGINT.
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
Change argument of pulongest from CORE_ADDR to ULONGEST.
All callers updated.
* utils.c (plongest): Renamed from paddr_d.
(pulongest): Renamed from paddr_u, change arg type to ULONGEST.
* remote-mips.c (send_srec): Use paddr_nz instead of paddr_u in
`CORE_ADDR addr' arg of error message.
Rewrite continuations internals on top of cleanups and plug
continuation arguments leaks.
* defs.h (struct continuation): Make it opaque.
(add_continuation, add_intermediate_continuation): Drop the int
argument of the continuation hook argument. Add
continuation_free_args argument.
(do_all_continuations, do_all_intermediate_continuations): Drop
the error_p argument.
* utils.c (add_continuation): Drop the int argument of the
continuation hook argument. Add continuation_free_args argument.
Reimplement on top of cleanups.
(do_all_continuations): Drop error argument. Reimplement on top
of cleanups.
(discard_all_continuations): Reimplement on top of cleanups.
(add_intermediate_continuation): Drop the int argument of the
continuation hook argument. Add continuation_free_args argument.
Reimplement on top of cleanups.
(do_all_intermediate_continuations): Drop error argument.
Reimplement on top of cleanups.
(discard_all_intermediate_continuations): Reimplement on top of
cleanups.
* breakpoint.c (until_break_command_continuation): Drop error
argument. Add xfree as continuation argument deleter.
* inf-loop.c (inferior_event_handler): On error, discard all
continuations. Adjust to new do_all_intermediate_continuations
and do_all_continuations interfaces.
* infcmd.c (step_1_continuation): Drop error_p argument. Adjust.
Pass xfree as continuation argument deleter.
(finish_command_continuation): Drop error_p argument. Adjust.
(finish_command_continuation_free_arg): New.
(finish_command): Pass finish_command_continuation_free_arg as
continuation argument deleter. Adjust to new do_all_continuations
interfaces.
(attach_command_continuation): Drop error_p argument.
(attach_command_continuation_free_args): New.
(attach_command): Pass attach_command_continuation_free_args as
continuation argument deleter.
* interps.c (interp_set): Adjust to new do_all_continuations
interfaces.
* event-top.c (stdin_event_handler): In error, also discard the
intermediate continuations.
* top.c (execute_command): Remove unused arg1 and arg2 locals.
* breakpoint.c (struct until_break_command_continuation_args):
New.
(until_break_command_continuation): Take a void* instead of a
continuations_arg. Adjust.
(until_break_command): Adjust to use struct
until_break_command_continuation_args instead of struct
continuation_arg.
* infcmd.c (struct step_1_continuation_args): New.
(step_1_continuation): Take a void* instead of a
continuations_arg. Adjust to use struct step_1_continuation_args.
(step_once): Adjust to use struct step_1_continuation_args.
(struct finish_command_continuation_args): New.
(finish_command_continuation): Take a void* instead of a
continuations_arg. Adjust to use struct
finish_command_continuation_args.
(finish_command): Adjust to use struct
finish_command_continuation_args.
(struct attach_command_continuation_args): New.
(attach_command_continuation): Take a void* instead of a
continuations_arg. Adjust to use struct
attach_command_continuation_args.
(attach_command): Adjust to use struct
attach_command_continuation_args.
* defs.h (struct continuation_arg): Delete.
(struct continuation): Replace the struct continuation_arg*
parameter of continuation_hook by a void*. Replace "arg_list"
member by a new "args" member with void* type.
(add_continuation, add_intermediate_continuation): Replace struct
continuation_arg type usages by void* usages.
* utils.c (add_continuation, do_all_continuations)
(add_intermediate_continuation)
(do_all_intermediate_continuations): Replace struct
continuation_arg type usages by void* usages. Pass "args" instead
of "arg_list".
* thread.c (enum thread_state): New.
(thread_state main_thread_running): Delete, in favor of...
(thread_state main_thread_state): ... this. Update throughout.
(clear_thread_inferior_resources): New, split from free_thread.
(free_thread): Call clear_thread_inferior_resources.
(init_thread_list): Set main thread to stopped state.
(add_thread_silent): Take care of PTID reuses.
(delete_thread): If deleting inferior_ptid or a thread with
refcount > 0, mark it as exited, but still keep it in the list.
Only notify of thread exits, if we haven't done so yet.
(iterate_over_threads): Make it safe to delete threads while
iterating over them.
(do_captured_list_thread_ids): Don't account for exited threads.
(thread_alive): Check for the THREAD_EXITED state, and don't set
ptid to -1 on exited threads.
(set_running): Update to account for extra possible states.
(is_thread_state): New.
(is_stopped, is_exited): New.
(is_running): Implement in terms of is_thread_state.
(any_running): Update.
(print_thread_info): Update. Account for exited threads. Don't
warn about missed frame restoring here, its done in the cleanup.
(switch_to_thread): Don't read from a thread that has gone.
(restore_current_thread): In non-stop mode, do a full context
switch.
(restore_selected_frame): Add a frame_level argument. Rewrite.
(struct current_thread_cleanup): Add selected_frame_level and
was_stopped members.
(do_restore_current_thread_cleanup): Check if thread was stopped
and still is, and if the target has registers, stack and memory
before restoring the selected frame. Don't delete the cleanup
argument here.
(restore_current_thread_cleanup_dtor): New.
(make_cleanup_restore_current_thread): Remove all arguments.
Rewrite.
(thread_apply_all_command): Update. Prune threads.
(thread_apply_command): Update.
(thread_command): Account for currently selected exited thread.
(do_captured_thread_select): Check for a running thread. Prune
threads.
(_initialize_thread): Make "info threads", "thread", "thread
apply", and "thread apply all" appliable without a selected thread.
* gdbthread.h (struct thread_info): Replace running_ by state_.
Add refcount.
(is_exited, is_stopped): Declare.
(make_cleanup_restore_current_thread): Remove all arguments.
* infrun.c: Include "event-top.h".
(fetch_inferior_event): In non-stop mode, restore selected thread
and frame after handling the event and running breakpoint
commands. Display GDB prompt if needed.
(normal_stop): In non-stop mode, don't print thread switching
notice.
* cli/cli-decode.c (set_cmd_no_selected_thread_ok)
(get_cmd_no_selected_thread_ok): New.
* cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): New.
(set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok):
Declare.
* cli/cli-cmds.c: Set "pwd", "help", "info", "show" as
no-selected-thread ok.
* top.c (execute_command): Check for non no-selected-thread-ok
commands.
* linux-nat.c (struct saved_ptids, threads_to_delete)
(record_dead_thread, prune_lwps): Delete.
(exit_lwp): Unconditionally delete thread.
(linux_nat_resume): Remove prune_lwps call.
* infcmd.c (proceed_thread_callback): Check if !is_stopped instead
of is_running. Adjust to make_cleanup_restore_current_thread
interface change.
* mi/mi-main.c (mi_cmd_execute): Only allow a few commands if the
selected thread has exited.
* inf-loop.c (inferior_event_handler): Don't display the prompt
here.
* varobj.c (c_value_of_root): Update.
* defs.h (make_cleanup_dtor): Declare.
* utils.c (make_cleanup_dtor): New.
* Makefile.in (infrun.o): Depend on $(event_top_h).
(gdb_stdint_h, gdb_stdint.h, stamp-int): Delete. Remove
all dependencies on $(gdb_stdint_h).
(distclean): Do not delete gdb_stdint.h.
* acinclude.m4: Do not use stdint.m4.
* configure.ac: Set GNULIB_STDINT_H. Remove tests for stdint.h,
uintptr_t, and gdb_stdint.h.
* defs.h: Include <stdint.h>.
* gdb_thread_db.h: Assume stdint.h is already included.
* breakpoint.c, findcmd.c, hppa-tdep.c, inf-ptrace.c, proc-service.c,
rs6000-nat.c, spu-linux-nat.c, target.c, win32-nat.c: Do not
include gdb_stdint.h.
* configure, config.in: Regenerate.
* defs.h (make_cleanup_restore_integer): New declaration.
(struct cleanup): New field free_arg.
(make_my_cleanup_2): New.
* utils.c (restore_integer_closure, restore_integer)
(make_cleanup_restore_integer): New.
(make_my_cleanup): Initialize the free_arg field and
renamed to make_my_cleanup_2.
(do_my_cleanups): Call free_arg.
(discard_cleanups): Call free_arg.
* breakpoint.c (restore_always_inserted_mode): Remove.
(update_breakpoints_after_exec): Use make_cleanup_restore_integer.
core_regset_sections.
* gdbarch.c: Refreshed.
* gdbarch.h: Refreshed.
* regset.h (core_regset_section): Declared.
* linux-nat.c (linux_nat_do_thread_registers): Added
support for the new gdbarch struct core_regset_sections.
* utils.c (host_address_to_string): New function.
* defs.h (host_address_to_string): New prototype.
* i386-linux-tdep.c (i386_regset_rections): New register
sections list for i386.
(i386_linux_init_abi): Initialized new gdbarch struct
core_regset_sections.
* Makefile.in: Updated to reflect dependency changes.
* ppc-linux-tdep.c (ppc_regset_sections): Register
sections list for ppc.
(ppc_linux_init_abi): Initialized new gdbarch struct
core_regset_sections
* breakpoint.c (until_break_command_continuation): Add
the 'error' parameter. Directly delete the breakoint as
opposed to running cleanups.
(until_break_command): Install continuation only
after starting the target. Don't use exec cleanups,
use ordinary cleanups. Discard cleanups is successfully
started the target in async mode.
(make_cleanup_delete_breakpoint): Remove.
* breakpoint.h (make_cleanup_delete_breakpoint): Remove
declaration.
* defs.h (do_exec_cleanups, make_exec_cleanup): Remove
declarations.
(struct continations): Add the 'error' parameter to the
continuation_hook field.
(add_continuation, do_all_continuations)
(add_intermediate_continuation)
(do_all_intermediate_continuations): Add the 'error' parameter.
* exceptions.c (throw_exception): Don't call do_exec_cleanups.
* inf-loop.c (inferior_event_handler): Instead of calling
discard_all_continuations, use do_all_continuations with 1 as
'error' parameter. Pass 0 as 'error' parameter in existing uses
of discard_all_continuations.
* infcmd.c (step_1): Do not use exec cleanup. For async case, discard
cleanups.
(step_once): Install continuation only after resuming the target.
(step_1_continuation): Disable longjmp breakpoint on error.
(finish_command_continuation): Add the error parameter. Delete
the finish breakpoint directly, do not use cleanups.
(finish_command): Do not use exec_cleanups. Always setup
continuation. For sync case, immediately run them.
(attach_command_continuation): Add the error parameter.
* infrun.c (fetch_inferior_event): Do not use exec cleanups to
remove step_resume_breakpoint -- adjust delete it directly.
* interps.c (interp_set): Adjust call to do_all_continations.
* mi/mi-interp.c (mi_interpreter_exec_continuation): Do not
do exec cleanups.
* mi/mi-main.c (mi_cmd_target_select): Do not do exec
cleanups.
(mi_cmd_execute): Do not use exec_cleanup.
(mi_execute_async_cli_command): Simplify the string concatenation
logic. Do no use exec cleanup.
(mi_exec_async_cli_cmd_continuation): New parameter error.
Free last_async_command.
* top.c (command_line_handler_continuation): New parameter error.
* utils.c (exec_cleanup_chain, make_exec_cleanup)
(do_exec_cleanups): Remove.
(add_continuation, do_all_continations)
(add_intermediate_continuation)
(do_all_intermediate_continuations): New parameter error.
non-contiguous address ranges.
* addrmap.c, addrmap.h: New files.
* block.h (struct addrmap): New forward declaration.
(struct blockvector): New member, 'map'.
(BLOCKVECTOR_MAP): New accessor macro.
* block.c: #include "addrmap.h"
(blockvector_for_pc_sect): If the blockvector we've found has
an address map, use it instead of searching the blocks.
* buildsym.c: #include "addrmap.h"
(pending_addrmap_obstack, pending_addrmap_interesting): New static
variables.
(really_free_pendings): If we have a pending addrmap, free it too.
(record_block_range): New function.
(make_blockvector): If we have an interesting pending addrmap,
record it in the new blockvector.
(start_symtab, buildsym_init): Assert that there is no pending
addrmap now; we should have cleaned up any addrmaps we'd built
previously.
(end_symtab): If there is a pending addrmap left over that didn't
get included in the blockvector, free it.
* buildsym.h (struct addrmap): New forward declaration.
(record_block_range): New prototype.
* objfiles.c: #include "addrmap.h".
(objfile_relocate): Relocate the blockvector's address map, if
present.
* dwarf2read.c (dwarf2_record_block_ranges): New function.
(read_func_scope, read_lexical_block_scope): Call it.
* Makefile.in (SFILES): Add addrmap.c.
(addrmap_h): New header dependency variable.
(COMMON_OBS): Add addrmap.o.
(addrmap.o): New rule.l
(block.o, objfiles.o, buildsym.o): Depend on $(addrmap_h).
* block.c (blockvector_for_pc, blockvector_for_pc_sect): Return a
pointer to the block, not its index in the blockvector.
(block_for_pc_sect): Use the returned block, instead of looking it
up ourselves.
* block.h (blockvector_for_pc, blockvector_for_pc_sect): Update
declarations.
* breakpoint.c (resolve_sal_pc): Use returned block, instead of
looking it up ourselves.
* stack.c (print_frame_label_vars): Disable function, which
depends on the block's index.
* buildsym.c (finish_block): Return the block we've built.
* buildsym.h (finish_block): Update prototype.
* defs.h (CORE_ADDR_MAX): New constant.
(GDB_XM_FILE, GDB_TM_FILE): Do not define.
(xm_h, tm_h): Likewise.
(DEPRECATED_TM_FILE, XM_FILE): Do not substitute into Makefile.
* configure, config.in: Regenerate.
* Makefile.in (xm_h, tm_h): Remove. Update dependencies.
(TAGS): Do not consider DEPRECATED_TM_FILE or XM_FILE.
(clean, local-maintainer-clean): Do not remove xm.h or tm.h.
* defs.h: Do not include "xm.h" or "tm.h".
* gdbarch.sh (verify_gdbarch): Do not dump GDB_XM_FILE or GDB_TM_FILE.
* gdbarch.c: Regenerate.
* config/score/embed.mt: Remove obsolete comment.
* dwarf2read.c (read_file_scope): Use DW_AT_name if DW_AT_comp_dir is
missing.
* utils.c (ldirname): New function.
* xml-tdesc.c (file_read_description_xml): Use ldirname.
* interps.c (clear_interpreter_hooks): Do not clear
deprecated_registers_changed_hook.
* regcache.c (registers_changed): Do not call it.
* top.c (deprecated_registers_changed_hook): Do not define it.
* mi/mi-interp.c (mi_command_loop): Do not clear it.
* tui/tui-hooks.c (tui_install_hooks): Do not install it.
(tui_remove_hooks): Do not remove it.
(tui_selected_frame_level_changed_hook): Check for negative level.
Use get_selected_frame.
(tui_registers_changed_hook): Deleted.
(build_command_line): Require arguments only for if and while commands.
(get_command_line, execute_user_command, execute_control_command):
Fix wording of warning messages.
(print_command_lines): Print breakpoint commands.
(execute_control_command): Call commands_from_control_command to
handle the `commands' command inside a body of a flow-control command.
(read_next_line): Recognize the `commands' command and build a
command line structure for it.
(recurse_read_control_structure, read_command_lines): Handle
`commands' similarly to `if' and `while'.
* breakpoint.c (get_number_trailer): Document the special meaning
of NULL as the first argument PP.
(commands_from_control_command): New function.
* breakpoint.h (commands_from_control_command): Add prototype.
* defs.h (commands_control): New enumerated value for enum
command_control_type.
exec_prefix.
(TARGET_SYSTEM_ROOT_RELOCATABLE): Allow for exec_prefix being
'${prefix}'.
* configure, config.in: Regenerate.
* defs.h (debug_file_directory): Declare.
* main.c (captured_main): Canonicalize gdb_sysroot. Assume
TARGET_SYSTEM_ROOT is defined. Initialize debug_file_directory and
relocate it if DEBUGDIR_RELOCATABLE.
* symfile.c (debug_file_directory): Make non-static.
(find_separate_debug_file): Look for debug info for SYSROOT/PATH
in DEBUGDIR/PATH if DEBUGDIR is inside SYSROOT.
(_initialize_symfile): Don't initialize debug_file_directory here.