binutils-gdb/gdb/infcmd.c

2895 lines
83 KiB
C
Raw Normal View History

/* Memory-access and commands for "inferior" process, for GDB.
2007-01-09 18:59:20 +01:00
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
1999-07-07 22:19:36 +02:00
This file is part of GDB.
1999-07-07 22:19:36 +02:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
1999-07-07 22:19:36 +02:00
(at your option) any later version.
1999-07-07 22:19:36 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1999-07-07 22:19:36 +02:00
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
#include "arch-utils.h"
#include <signal.h>
#include "gdb_string.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "frame.h"
#include "inferior.h"
#include "environ.h"
#include "value.h"
#include "gdbcmd.h"
2001-01-26 Fernando Nasser <fnasser@redhat.com> 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.
2001-01-27 01:43:26 +01:00
#include "symfile.h"
#include "gdbcore.h"
#include "target.h"
#include "language.h"
#include "symfile.h"
#include "objfiles.h"
* completer.c (gdb_completer_loc_break_characters): New variable. (line_completion_function): If we are completing on locations, back up the start of word pointer past all characters which can appear in a location spec. (location_completer): New function. * completer.h: Add prototype for location_completer. * symtab.c (make_source_files_completion_list) (add_filename_to_list, not_interesting_fname): New functions. (filename_seen): New function, body extracted from output_source_filename. (output_source_filename): Call filename_seen to check if the file was already printed. (make_symbol_completion_list): If TEXT includes a double-quoted string, return an empty list, not NULL. (make_file_symbol_completion_list): New function, similar to make_symbol_completion_list but with an additional argument SRCFILE. * symtab.h (make_file_symbol_completion_list) (make_source_files_completion_list): Add prototypes. * breakpoint.c (_initialize_breakpoint): Make location_completer be the completion function for all commands which set breakpoints and watchpoints. (top-level): #include "completer.h". * tracepoint.c (_initialize_tracepoint): Make location_completer be the completion function for the "trace" command. (top-level): #include "completer.h". * printcmd.c (_initialize_printcmd): Make location_completer be the completion function for the "print", "inspect", "call", and "disassemble" commands. (top-level): #include "completer.h". * infcmd.c (_initialize_infcmd): Make location_completer be the completion function for the "go", "jump", and "until" commands. (top-level): #include "completer.h".
2001-06-11 18:05:25 +02:00
#include "completer.h"
2000-02-03 05:14:45 +01:00
#include "ui-out.h"
1999-09-28 23:55:21 +02:00
#include "event-top.h"
1999-08-09 23:36:23 +02:00
#include "parser-defs.h"
#include "regcache.h"
#include "reggroups.h"
2003-02-19 David Carlton <carlton@math.stanford.edu> * Makefile.in (SFILES): Add block.c. (block_h): New. (COMMON_OBS): Add block.o. (block.o): New. (x86-64-tdep.o): Add $(block_h). (values.o, valops.o, tracepoint.o, symtab.o, symmisc.o, symfile.o) (stack.o, printcmd.o, p-exp.tab.o, parse.o, objfiles.o) (objc-exp.tab.o, objc-lang.o, nlmread.o, mips-tdep.o, mdebugread.o) (m2-exp.tab.o, linespec.o, jv-lang.o, jv-exp.tab.o, infcmd.o) (f-valprint.o, findvar.o, f-exp.tab.o, expprint.o, coffread.o) (c-exp.tab.o, buildsym.o, breakpoint.o, blockframe.o, ax-gdb.o) (alpha-tdep.o, ada-lang.o, ada-exp.tab.o, mi-cmd-stack.o): Ditto. * value.h: Add opaque declaration for struct block. * parser-defs.h, objc-lang.h, buildsym.h, breakpoint.h: Ditto. * ada-lang.h: Ditto. * x86-64-tdep.c: #include "block.h" * values.c, valops.c, tracepoint.c, symtab.c, symmisc.c: Ditto. * symfile.c, stack.c, printcmd.c, p-exp.y, parse.c: Ditto. * objfiles.c, objc-exp.y, objc-lang.c, nlmread.c: Ditto. * mips-tdep.c, mdebugread.c, m2-exp.y, linespec.c: Ditto. * jv-lang.c, jv-exp.y, infcmd.c, f-valprint.c: Ditto. * findvar.c, f-exp.y, expprint.c, coffread.c, c-exp.y: Ditto. * buildsym.c, breakpoint.c, blockframe.c, ax-gdb.c: Ditto. * alpha-tdep.c, ada-lang.c, ada-exp.y: Ditto. * blockframe.c (blockvector_for_pc_sect): Move to "block.c". (blockvector_for_pc, block_for_pc_sect, block_for_pc): Ditto. * symtab.c (block_function): Ditto. (contained_in): Ditto. * frame.h: Move block_for_pc and block_for_pc_sect declarations to block.h. Add opaque declaration for struct block. * symtab.h: Move block_function and contained_in declarations to block.h. Add opaque declarations for struct block, struct blockvector. (struct block): Move to block.h. (struct blockvector): Ditto. (BLOCK_START, BLOCK_END, BLOCK_FUNCTION, BLOCK_SUPERBLOCK) (BLOCK_GCC_COMPILED, BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM) (BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE) (ALL_BLOCK_SYMBOLS, BLOCK_SHOULD_SORT, BLOCKVECTOR_NBLOCKS) (BLOCKVECTOR_BLOCK, GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): Ditto. * block.c: New file. * block.h: New file. 2003-02-19 David Carlton <carlton@math.stanford.edu> * mi-cmd-stack.c: #include "block.h"
2003-02-20 01:01:07 +01:00
#include "block.h"
* solib.h (CLEAR_SOLIB, SOLIB_ADD) (SOLIB_CREATE_INFERIOR_HOOK, SOLIB_REMOVE_INFERIOR_HOOK) (SOLIB_IN_DYNAMIC_LINKER, SOLIB_RESTART) (DISABLE_UNSETTABLE_BREAK, PC_SOLIB) (IN_SOLIB_DYNSYM_RESOLVE_CODE): Remove defines and orphaned comments. * breakpoint.c: Include "solib.h". (insert_bp_location) [!DISABLE_UNSETTABLE_BREAK]: Call solib_address. (remove_solib_event_breakpoints, create_solib_event_breakpoint) (disable_breakpoints_in_shlibs) (disable_breakpoints_in_unloaded_shlib) (re_enable_breakpoints_in_shlibs): Compile if SOLIB_ADD isn't defined. If PC_SOLIB isn't defined, call solib_address. (_initialize_breakpoint): Unconditionally install observer. * corelow.c: Include "solib.h". [SOLIB_ADD] (solib_add_stub): Remove prototype. (core_close) [!CLEAR_SOLIB]: Call clear_solib. (solib_add_stub) [!SOLIB_ADD] Call solib_add. (core_open): Unconditionally call solib_add_stub. * fork-child.c: Include "solib.h". (fork_inferior) [!SOLIB_CREATE_INFERIOR_HOOK]: Call solib_create_inferior_hook. * infcmd.c: Include "solib.h". (attach_command) [!SOLIB_ADD]: Call shlib_rescan. Unconditionally call re_enable_breakpoints_in_shlibs. * infrun.c: Include "solib.h". (SOLIB_IN_SYNSYM_RESOLVE_CODE): Don't define if not already defined. (stop_on_solib_events, show_stop_on_solib_events): Include unconditionally. (follow_exec) [!SOLIB_CREATE_INFERIOR_HOOK]: Call solib_create_inferior_hook. (handle_inferior_event) [!SOLIB_ADD]: Call shlib_add. [!IN_SOLIB_DYNSYM_RESOLVE_CODE]: Call in_solib_dynsym_resolve_code. (_initialize_infrun): Unconditionally add "stop_on_solib-events" command. * remote.c: Include "solib.h". (remote_open_1): Unconditionally call no_shared_libraries. [!SOLIB_CREATE_INFERIOR_HOOK] Call solib_create_inferior_hook. * stack.c: Include "solib.h". (print_frame) [!PC_SOLIB] Call shlib_for_pc. * xcoffsolib.c (no_shared_libraries): Remove function. * Makefile.in (SFILES): Add solib.c. (ALLDEPFILES): Remove solib.c. (COMMON_OBS): Add solib.o. (breakpoint.o, corelow.o, fork-chiled.o, infcmd.o, infrun.o) (remote.o, stack.o): Update dependencies.
2005-05-12 22:21:18 +02:00
#include "solib.h"
#include <ctype.h>
#include "gdb_assert.h"
#include "observer.h"
#include "target-descriptions.h"
#include "user-regs.h"
#include "exceptions.h"
#include "cli/cli-decode.h"
#include "gdbthread.h"
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
#include "valprint.h"
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
#include "inline-frame.h"
#include "tracepoint.h"
2010-01-06 21:31:28 +01:00
/* Functions exported for general use, in inferior.h: */
2000-05-28 03:12:42 +02:00
void all_registers_info (char *, int);
2000-05-28 03:12:42 +02:00
void registers_info (char *, int);
void nexti_command (char *, int);
void stepi_command (char *, int);
2000-05-28 03:12:42 +02:00
void continue_command (char *, int);
void interrupt_target_command (char *args, int from_tty);
/* Local functions: */
static void nofp_registers_info (char *, int);
doc/ChangeLog: -------------- * gdb.texinfo (Set SH Calling convention): New @item. (Show SH Calling convention): Ditto. ChangeLog: ---------- * NEWS: Add information on calling convention and new SH CLI options. * sh-tdep.c (sh_cc_gcc): New static string. (sh_cc_renesas): Ditto. (sh_cc_enum): New static string array. (sh_active_calling_convention): New static string pointer denoting active user chosen ABI. (sh_is_renesas_calling_convention): New function to return function specific ABI, or user choice if necessary. (sh_use_struct_convention): Rename first argument and turn around its meaning. Check for renesas ABI and return accordingly. (sh_use_struct_convention_nofpu): New function. (sh_next_flt_argreg): Get function type as third parameter. Check for renesas ABI and choose floating registers accordingly. (sh_push_dummy_call_fpu): Check for ABI and choose argument slot and struct return slot accordingly. (sh_push_dummy_call_nofpu): Ditto. (sh_return_value_nofpu): Call sh_use_struct_convention_nofpu from here. Evaluate ABI and give to sh_use_struct_convention_nofpu. (sh_return_value_fpu): Evaluate ABI and give to sh_use_struct_convention. (show_sh_command): New function. (set_sh_command): Ditto. (_initialize_sh_tdep): Initialize `set/show sh calling-convention CLI command. * gdbarch.sh (return_value): Add func_type argument. * gdbarch.c: Regenerate. * gdbarch.h: Ditto. * eval.c (evaluate_subexp_standard): Rename local variable value_type to val_type so as not to collide with value_type function. Call using_struct_return with additional function type argument. * infcall.c (call_function_by_hand): Call using_struct_return and gdbarch_return_value with additional function type argument. * infcmd.c (print_return_value): Take addition func_type argument. Call gdbarch_return_value with additional function type argument. (finish_command_continuation): Call print_return_value with additional function type argument. (finish_command): Ditto. * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with additional function type argument. * stack.c (return_command): Call using_struct_return and gdbarch_return_value with additional function type argument. * value.c (using_struct_return): Take additional function type argument. * value.h (using_struct_return): Accommodate declaration. * alpha-tdep.c (alpha_return_value): Add func_type argument. * amd64-tdep.c (amd64_return_value): Ditto. * arm-tdep.c (arm_return_value): Ditto. * avr-tdep.c (avr_return_value): Ditto. * cris-tdep.c (cris_return_value): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_return_value): Ditto. (h8300h_return_value): Ditto. * hppa-tdep.c (hppa32_return_value): Ditto. (hppa64_return_value): Ditto. * i386-tdep.c (i386_return_value): Ditto. * ia64-tdep.c (ia64_return_value): Ditto. * iq2000-tdep.c (iq2000_return_value): Ditto. * m32c-tdep.c (m32c_return_value): Ditto. * m32r-tdep.c (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_return_value): Ditto. * m68k-tdep.c (m68k_return_value): Ditto. (m68k_svr4_return_value): Ditto. * m88k-tdep.c (m88k_return_value): Ditto. * mep-tdep.c (mep_return_value): Ditto. * mips-tdep.c (mips_eabi_return_value): Ditto. (mips_n32n64_return_value): Ditto. (mips_o32_return_value): Ditto. (mips_o64_return_value): Ditto. * mn10300-tdep.c (mn10300_return_value): Ditto. * mt-tdep.c (mt_return_value): Ditto. * ppc-linux-tdep.c (ppc_linux_return_value): Ditto. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto. * rs6000-tdep.c (rs6000_return_value): Ditto. * s390-tdep.c (s390_return_value): Ditto. * score-tdep.c (score_return_value): Ditto. * sh-tdep.c (sh_return_value_nofpu): Ditto. (sh_return_value_fpu): Ditto. * sh64-tdep.c (sh64_return_value): Ditto. * sparc-tdep.c (sparc32_return_value): Ditto. * sparc64-tdep.c (sparc64_return_value): Ditto. * spu-tdep.c (spu_return_value): Ditto. * v850-tdep.c (v850_return_value): Ditto. * vax-tdep.c (vax_return_value): Ditto. * xstormy16-tdep.c (xstormy16_return_value): Ditto. * xtensa-tdep.c (xtensa_return_value): Ditto. * gdbtypes.h (struct type): Add calling_convention member. * dwarf2read.c (read_subroutine_type): Add calling convention read from DW_AT_calling_convention attribute to function type.
2008-04-22 13:03:42 +02:00
static void print_return_value (struct type *func_type,
struct type *value_type);
1999-11-09 02:23:30 +01:00
2000-05-28 03:12:42 +02:00
static void until_next_command (int);
2000-05-28 03:12:42 +02:00
static void until_command (char *, int);
2000-05-28 03:12:42 +02:00
static void path_info (char *, int);
2000-05-28 03:12:42 +02:00
static void path_command (char *, int);
2000-05-28 03:12:42 +02:00
static void unset_command (char *, int);
2000-05-28 03:12:42 +02:00
static void float_info (char *, int);
static void disconnect_command (char *, int);
2000-05-28 03:12:42 +02:00
static void unset_environment_command (char *, int);
2000-05-28 03:12:42 +02:00
static void set_environment_command (char *, int);
2000-05-28 03:12:42 +02:00
static void environment_info (char *, int);
2000-05-28 03:12:42 +02:00
static void program_info (char *, int);
2000-05-28 03:12:42 +02:00
static void finish_command (char *, int);
2000-05-28 03:12:42 +02:00
static void signal_command (char *, int);
2000-05-28 03:12:42 +02:00
static void jump_command (char *, int);
2000-05-28 03:12:42 +02:00
static void step_1 (int, int, char *);
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
static void step_once (int skip_subroutines, int single_inst, int count, int thread);
2000-05-28 03:12:42 +02:00
static void next_command (char *, int);
2000-05-28 03:12:42 +02:00
static void step_command (char *, int);
2000-05-28 03:12:42 +02:00
static void run_command (char *, int);
2000-05-28 03:12:42 +02:00
static void run_no_args_command (char *args, int from_tty);
1999-05-25 20:09:09 +02:00
2000-05-28 03:12:42 +02:00
static void go_command (char *line_no, int from_tty);
1999-05-25 20:09:09 +02:00
2000-05-28 03:12:42 +02:00
static int strip_bg_char (char **);
1999-07-05 19:58:44 +02:00
2000-05-28 03:12:42 +02:00
void _initialize_infcmd (void);
#define ERROR_NO_INFERIOR \
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
if (!target_has_execution) error (_("The program is not being run."));
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
/* Scratch area where string containing arguments to give to the program will be
stored by 'set args'. As soon as anything is stored, notice_args_set will
move it into per-inferior storage. Arguments are separated by spaces. Empty
string (pointer to '\0') means no args. */
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
static char *inferior_args_scratch;
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
/* Scratch area where 'set inferior-tty' will store user-provided value.
We'll immediate copy it into per-inferior storage. */
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
static char *inferior_io_terminal_scratch;
/* Pid of our debugged inferior, or 0 if no inferior now.
Since various parts of infrun.c test this to see whether there is a program
being debugged it should be nonzero (currently 3 is used) for remote
debugging. */
2001-05-04 06:15:33 +02:00
ptid_t inferior_ptid;
/* Address at which inferior stopped. */
CORE_ADDR stop_pc;
/* Flag indicating that a command has proceeded the inferior past the
current breakpoint. */
int breakpoint_proceeded;
/* Nonzero if stopped due to completion of a stack dummy routine. */
2010-03-25 21:48:53 +01:00
enum stop_stack_kind stop_stack_dummy;
/* Nonzero if stopped due to a random (unexpected) signal in inferior
process. */
int stopped_by_random_signal;
/* Accessor routines. */
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
/* Set the io terminal for the current inferior. Ownership of
TERMINAL_NAME is not transferred. */
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
void
set_inferior_io_terminal (const char *terminal_name)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
xfree (current_inferior ()->terminal);
current_inferior ()->terminal = terminal_name ? xstrdup (terminal_name) : 0;
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
}
const char *
get_inferior_io_terminal (void)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
return current_inferior ()->terminal;
}
static void
set_inferior_tty_command (char *args, int from_tty,
struct cmd_list_element *c)
{
/* CLI has assigned the user-provided value to inferior_io_terminal_scratch.
Now route it to current inferior. */
set_inferior_io_terminal (inferior_io_terminal_scratch);
}
static void
show_inferior_tty_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
/* Note that we ignore the passed-in value in favor of computing it
directly. */
const char *inferior_io_terminal = get_inferior_io_terminal ();
if (inferior_io_terminal == NULL)
inferior_io_terminal = "";
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
fprintf_filtered (gdb_stdout,
_("Terminal for future runs of program being debugged "
"is \"%s\".\n"), inferior_io_terminal);
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
}
char *
get_inferior_args (void)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
if (current_inferior ()->argc != 0)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
char *n;
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
n = construct_inferior_arguments (current_inferior ()->argc,
current_inferior ()->argv);
set_inferior_args (n);
xfree (n);
}
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
if (current_inferior ()->args == NULL)
current_inferior ()->args = xstrdup ("");
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
return current_inferior ()->args;
}
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
/* Set the arguments for the current inferior. Ownership of
NEWARGS is not transferred. */
void
set_inferior_args (char *newargs)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
xfree (current_inferior ()->args);
current_inferior ()->args = newargs ? xstrdup (newargs) : NULL;
current_inferior ()->argc = 0;
current_inferior ()->argv = 0;
}
1999-07-07 22:19:36 +02:00
void
set_inferior_args_vector (int argc, char **argv)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
current_inferior ()->argc = argc;
current_inferior ()->argv = argv;
}
/* Notice when `set args' is run. */
static void
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_args_command (char *args, int from_tty, struct cmd_list_element *c)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
/* CLI has assigned the user-provided value to inferior_args_scratch.
Now route it to current inferior. */
set_inferior_args (inferior_args_scratch);
}
/* Notice when `show args' is run. */
static void
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
show_args_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
/* Note that we ignore the passed-in value in favor of computing it
directly. */
deprecated_show_value_hack (file, from_tty, c, get_inferior_args ());
}
/* Compute command-line string given argument vector. This does the
same shell processing as fork_inferior. */
char *
construct_inferior_arguments (int argc, char **argv)
{
char *result;
if (STARTUP_WITH_SHELL)
{
/* This holds all the characters considered special to the
typical Unix shells. We include `^' because the SunOS
/bin/sh treats it as a synonym for `|'. */
char *special = "\"!#$&*()\\|[]{}<>?'\"`~^; \t\n";
int i;
int length = 0;
char *out, *cp;
/* We over-compute the size. It shouldn't matter. */
for (i = 0; i < argc; ++i)
length += 3 * strlen (argv[i]) + 1 + 2 * (argv[i][0] == '\0');
result = (char *) xmalloc (length);
out = result;
for (i = 0; i < argc; ++i)
{
if (i > 0)
*out++ = ' ';
/* Need to handle empty arguments specially. */
if (argv[i][0] == '\0')
{
*out++ = '\'';
*out++ = '\'';
}
else
{
for (cp = argv[i]; *cp; ++cp)
{
if (*cp == '\n')
{
/* A newline cannot be quoted with a backslash (it
just disappears), only by putting it inside
quotes. */
*out++ = '\'';
*out++ = '\n';
*out++ = '\'';
}
else
{
if (strchr (special, *cp) != NULL)
*out++ = '\\';
*out++ = *cp;
}
}
}
}
*out = '\0';
}
else
{
/* In this case we can't handle arguments that contain spaces,
tabs, or newlines -- see breakup_args(). */
int i;
int length = 0;
for (i = 0; i < argc; ++i)
{
char *cp = strchr (argv[i], ' ');
if (cp == NULL)
cp = strchr (argv[i], '\t');
if (cp == NULL)
cp = strchr (argv[i], '\n');
if (cp != NULL)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("can't handle command-line argument containing whitespace"));
length += strlen (argv[i]) + 1;
}
result = (char *) xmalloc (length);
result[0] = '\0';
for (i = 0; i < argc; ++i)
{
if (i > 0)
strcat (result, " ");
strcat (result, argv[i]);
}
}
return result;
}
1999-07-05 19:58:44 +02:00
/* This function detects whether or not a '&' character (indicating
background execution) has been added as *the last* of the arguments ARGS
of a command. If it has, it removes it and returns 1. Otherwise it
does nothing and returns 0. */
1999-07-07 22:19:36 +02:00
static int
2000-07-30 03:48:28 +02:00
strip_bg_char (char **args)
1999-07-05 19:58:44 +02:00
{
char *p = NULL;
1999-07-07 22:19:36 +02:00
1999-07-07 19:31:57 +02:00
p = strchr (*args, '&');
1999-07-07 22:19:36 +02:00
1999-07-07 19:31:57 +02:00
if (p)
1999-07-05 19:58:44 +02:00
{
if (p == (*args + strlen (*args) - 1))
{
1999-07-07 22:19:36 +02:00
if (strlen (*args) > 1)
1999-07-05 19:58:44 +02:00
{
do
p--;
while (*p == ' ' || *p == '\t');
*(p + 1) = '\0';
}
else
*args = 0;
return 1;
}
}
return 0;
}
/* Common actions to take after creating any sort of inferior, by any
means (running, attaching, connecting, et cetera). The target
should be stopped. */
void
post_create_inferior (struct target_ops *target, int from_tty)
{
/* Be sure we own the terminal in case write operations are performed. */
target_terminal_ours ();
/* If the target hasn't taken care of this already, do it now.
Targets which need to access registers during to_open,
to_create_inferior, or to_attach should do it earlier; but many
don't need to. */
target_find_description ();
/* Now that we know the register layout, retrieve current PC. */
* inferior.h (read_pc, write_pc): Remove. * regcache.c (read_pc, write_pc): Remove. * infrun.c (displaced_step_fixup): Use regcache_read_pc instead of read_pc. (handle_inferior_event): Use regcache_read_pc instead of read_pc when determining value of stop_pc. Replace subsequent uses of read_pc by inspecting already-retrieved stop_pc value. (keep_going): Use regcache_read_pc instead of read_pc. * breakpoint.c (watchpoint_check): Use current frame architecture and PC instead of current_gdbarch and read_pc (). * tracepoint.c (set_traceframe_context): Replace PC argument with FRAME argument. (trace_start_command, finish_tfind_command): Update calls. (finish_tfind_command): Compare frame IDs to identify transitions between frames. (trace_find_pc_command): Use regcache_read_pc instead of read_pc. * rs6000-nat.c (exec_one_dummy_insn): Pass in regcache instead of gdbarch. Use regcache_read_pc and regcache_write_pc instead of read_pc and write_pc. (store_register): Make regcache argument non-const. Update call to exec_one_dummy_insn. * thread.c (switch_to_thread): Use regcache_read_pc instead of read_pc. * infcmd.c (post_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-sunos.c (sunos_solib_create_inferior_hook): Likewise. * solib-svr4.c (enable_break, svr4_relocate_main_executable): Likewise. * linux-fork.c (fork_load_infrun_state): Likewise. * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Likewise. * record.c (record_wait): Likewise. * procfs.c (procfs_wait): Likewise. * remote-mips.c (common_open, mips_wait): Likewise. * remote-m32r-sdi.c (m32r_resume): Likewise. * symfile.c (generic_load): Use regcache_write_pc instead of write_pc. * monitor.c (monitor_create_inferior, monitor_load): Likewise. * m32r-rom.c (m32r_load, m32r_upload_command): Likewise. * remote-m32r-sdi.c (m32r_create_inferior, m32r_load): Likewise. * remote-mips.c (mips_create_inferior, mips_load): Likewise. * solib-darwin.c: Include "regcache.h". * solib-pa64.c: Include "regcache.h". * solib-svr4.c: Include "regcache.h.". * symfile.c: Do not mention read_pc or write_pc in comments. * dink32-rom.c: Likewise. * m32r-rom.c: Likewise. * mips-tdep.c: Likewise.
2009-05-05 15:24:49 +02:00
stop_pc = regcache_read_pc (get_current_regcache ());
if (exec_bfd)
{
/* Create the hooks to handle shared library load and unload
events. */
#ifdef SOLIB_CREATE_INFERIOR_HOOK
SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
#else
gdb/ Add from_tty to solib_create_inferior_hook. * infcmd.c (post_create_inferior): Move solib_add after solib_create_inferior_hook. Pass from_tty to solib_create_inferior_hook. Call solib_add and SOLIB_ADD with 0 from_tty and comment why. * infrun.c (follow_exec): Pass from_tty solib_create_inferior_hook as 0. * linux-nat.c (linux_child_follow_fork): Likewise. * nto-procfs.c (procfs_post_attach, procfs_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): New parameter from_tty. * solib-frv.c (frv_solib_create_inferior_hook): Likewise. * solib-irix.c (irix_solib_create_inferior_hook): Likewise. * solib-null.c (null_solib_create_inferior_hook): Likewise. * solib-osf.c (osf_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * solib-spu.c (spu_solib_create_inferior_hook): New parameter from_tty. Pass it to svr4_so_ops.solib_create_inferior_hook. * solib-sunos.c (sunos_solib_create_inferior_hook): New parameter from_tty. * solib-svr4.c (enable_break): New parameter from_tty. Pass it to solib_add. (svr4_solib_create_inferior_hook): New parameter from_tty. Pass it to enable_break. * solib-target.c (solib_target_solib_create_inferior_hook): New parameter from_tty. * solib.c (solib_create_inferior_hook): New parameter from_tty. Pass it to ops->solib_create_inferior_hook. (reload_shared_libraries): Pass from_tty to solib_create_inferior_hook. Move solib_add after solib_create_inferior_hook, call it now with from_tty as 0. New comment there. * solib.h (solib_create_inferior_hook): New parameter from_tty. * solist.h (struct target_so_ops <solib_create_inferior_hook>): Likewise.
2010-01-08 23:52:04 +01:00
solib_create_inferior_hook (from_tty);
#endif
}
/* If the solist is global across processes, there's no need to
refetch it here. */
if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch))
{
/* Sometimes the platform-specific hook loads initial shared
libraries, and sometimes it doesn't. If it doesn't FROM_TTY will be
incorrectly 0 but such solib targets should be fixed anyway. If we
made all the inferior hook methods consistent, this call could be
removed. Call it only after the solib target has been initialized by
solib_create_inferior_hook. */
#ifdef SOLIB_ADD
SOLIB_ADD (NULL, 0, target, auto_solib_add);
#else
solib_add (NULL, 0, target, auto_solib_add);
#endif
}
/* If the user sets watchpoints before execution having started,
then she gets software watchpoints, because GDB can't know which
target will end up being pushed, or if it supports hardware
watchpoints or not. breakpoint_re_set takes care of promoting
watchpoints to hardware watchpoints if possible, however, if this
new inferior doesn't load shared libraries or we don't pull in
symbols from any other source on this target/arch,
breakpoint_re_set is never called. Call it now so that software
watchpoints get a chance to be promoted to hardware watchpoints
if the now pushed target supports hardware watchpoints. */
breakpoint_re_set ();
observer_notify_inferior_created (target, from_tty);
}
/* Kill the inferior if already running. This function is designed
to be called when we are about to start the execution of the program
from the beginning. Ask the user to confirm that he wants to restart
the program being debugged when FROM_TTY is non-null. */
static void
kill_if_already_running (int from_tty)
{
2001-05-04 06:15:33 +02:00
if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
/* Bail out before killing the program if we will not be able to
restart it. */
target_require_runnable ();
1999-07-20 01:30:11 +02:00
if (from_tty
&& !query (_("The program being debugged has been started already.\n\
Start it from the beginning? ")))
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Program not restarted."));
target_kill ();
}
}
/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert
a temporary breakpoint at the begining of the main program before
running the program. */
static void
run_command_1 (char *args, int from_tty, int tbreak_at_main)
{
char *exec_file;
struct cleanup *old_chain;
ptid_t ptid;
dont_repeat ();
kill_if_already_running (from_tty);
init_wait_for_inferior ();
clear_breakpoint_hit_counts ();
gdb/ 2006-09-21 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> * Makefile.in (SFILES): Add memory-map.c and xml-support.c. (memory_map_h, xml_support_h): New. (target_h): Add vec_h dependency. (COMMON_OBS): Add memory-map.o and xml-support.o. (memory-map.o, xml-support.o): New rules. (remote.o): Update. * exceptions.h (enum errors): Add XML_PARSE_ERROR. * infcmd.c (run_command_1, attach_command): Call target_pre_inferior. * memattr.c (default_mem_attrib): Initialize blocksize. (target_mem_region_list, mem_use_target) (target_mem_regions_valid, mem_region_cmp, mem_region_init) (require_user_regions, require_target_regions) (invalidate_target_mem_regions): New. (create_mem_region): Use mem_region_init. (mem_clear): Move higher. (lookup_mem_region): Use require_target_regions. (mem_command): Implement "mem auto". (mem_info_command): Handle target-supplied regions and flash attributes. (mem_enable_command, mem_disable_command, mem_delete_command): Use require_user_regions. (_initialize_mem): Mention "mem auto" in help. * memattr.h (enum mem_access_mode): Add MEM_FLASH. (struct mem_attrib): Add blocksize. (invalidate_target_mem_regions, mem_region_init, mem_region_cmp): New prototypes. * remote.c: Include "memory-map.h". (PACKET_qXfer_memory_map): New enum value. (remote_protocol_features): Add qXfer:memory-map:read. (remote_xfer_partial): Handle memory maps. (remote_memory_map): New. (init_remote_ops, init_remote_async_ops): Set to_memory_map. (_initialize_remote): Register qXfer:memory-map:read. * target.c (update_current_target): Mention to_memory_map. (target_memory_map, target_pre_inferior): New. (target_preopen): Call target_pre_inferior. * target.h: Include "vec.h". (enum target_object): Add TARGET_OBJECT_MEMORY_MAP. (struct target_ops): Add to_memory_map. (target_memory_map, target_pre_inferior): New prototypes. * memory-map.c, memory-map.h, xml-support.c, xml-support.h: New files. gdb/doc/ 2006-09-21 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> * gdb.texinfo (Memory Region Attributes): Mention target-supplied memory regions and "mem auto".
2006-09-21 15:54:03 +02:00
/* Clean up any leftovers from other runs. Some other things from
this function should probably be moved into target_pre_inferior. */
target_pre_inferior (from_tty);
/* The comment here used to read, "The exec file is re-read every
time we do a generic_mourn_inferior, so we just have to worry
about the symbol file." The `generic_mourn_inferior' function
gets called whenever the program exits. However, suppose the
program exits, and *then* the executable file changes? We need
to check again here. Since reopen_exec_file doesn't do anything
if the timestamp hasn't changed, I don't see the harm. */
reopen_exec_file ();
reread_symbols ();
/* Insert the temporary breakpoint if a location was specified. */
if (tbreak_at_main)
tbreak_command (main_name (), 0);
exec_file = (char *) get_exec_file (0);
if (non_stop && !target_supports_non_stop ())
error (_("The target does not support running in non-stop mode."));
/* We keep symbols from add-symbol-file, on the grounds that the
user might want to add some symbols before running the program
(right?). But sometimes (dynamic loading where the user manually
introduces the new symbols with add-symbol-file), the code which
the symbols describe does not persist between runs. Currently
the user has to manually nuke all symbols between runs if they
want them to go away (PR 2207). This is probably reasonable. */
1999-07-05 19:58:44 +02:00
if (!args)
1999-09-28 23:55:21 +02:00
{
if (target_can_async_p ())
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
}
1999-07-05 19:58:44 +02:00
else
{
1999-07-05 19:58:44 +02:00
int async_exec = strip_bg_char (&args);
/* If we get a request for running in the bg but the target
doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
/* If we don't get a request of running in the bg, then we need
1999-07-07 22:19:36 +02:00
to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
1999-07-05 19:58:44 +02:00
{
/* Simulate synchronous execution */
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
1999-07-05 19:58:44 +02:00
}
/* If there were other args, beside '&', process them. */
if (args)
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_inferior_args (args);
}
if (from_tty)
{
2000-02-03 05:14:45 +01:00
ui_out_field_string (uiout, NULL, "Starting program");
ui_out_text (uiout, ": ");
if (exec_file)
ui_out_field_string (uiout, "execfile", exec_file);
ui_out_spaces (uiout, 1);
/* We call get_inferior_args() because we might need to compute
the value now. */
ui_out_field_string (uiout, "infargs", get_inferior_args ());
2000-02-03 05:14:45 +01:00
ui_out_text (uiout, "\n");
ui_out_flush (uiout);
}
/* We call get_inferior_args() because we might need to compute
the value now. */
target_create_inferior (exec_file, get_inferior_args (),
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
environ_vector (current_inferior ()->environment), from_tty);
/* We're starting off a new process. When we get out of here, in
non-stop mode, finish the state of all threads of that process,
but leave other threads alone, as they may be stopped in internal
events --- the frontend shouldn't see them as stopped. In
all-stop, always finish the state of all threads, as we may be
resuming more than just the new process. */
if (non_stop)
ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
else
ptid = minus_one_ptid;
old_chain = make_cleanup (finish_thread_state_cleanup, &ptid);
2007-09-04 03:12:18 +02:00
/* Pass zero for FROM_TTY, because at this point the "run" command
has done its thing; now we are setting up the running program. */
post_create_inferior (&current_target, 0);
/* Start the target running. Do not use -1 continuation as it would skip
breakpoint right at the entry point. */
proceed (regcache_read_pc (get_current_regcache ()), TARGET_SIGNAL_0, 0);
/* Since there was no error, there's no need to finish the thread
states here. */
discard_cleanups (old_chain);
}
static void
run_command (char *args, int from_tty)
{
run_command_1 (args, from_tty, 0);
}
static void
2000-07-30 03:48:28 +02:00
run_no_args_command (char *args, int from_tty)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_inferior_args ("");
}
1999-07-07 22:19:36 +02:00
/* Start the execution of the program up until the beginning of the main
program. */
static void
start_command (char *args, int from_tty)
{
/* Some languages such as Ada need to search inside the program
minimal symbols for the location where to put the temporary
breakpoint before starting. */
if (!have_minimal_symbols ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("No symbol table loaded. Use the \"file\" command."));
/* Run the program until reaching the main procedure... */
run_command_1 (args, from_tty, 1);
}
static int
proceed_thread_callback (struct thread_info *thread, void *arg)
{
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
/* We go through all threads individually instead of compressing
into a single target `resume_all' request, because some threads
may be stopped in internal breakpoints/events, or stopped waiting
for its turn in the displaced stepping queue (that is, they are
running && !executing). The target side has no idea about why
the thread is stopped, so a `resume_all' command would resume too
much. If/when GDB gains a way to tell the target `hold this
thread stopped until I say otherwise', then we can optimize
this. */
Exited threads. * 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).
2008-07-11 13:07:39 +02:00
if (!is_stopped (thread->ptid))
return 0;
switch_to_thread (thread->ptid);
clear_proceed_status ();
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
return 0;
}
2009-03-25 22:42:35 +01:00
void
ensure_valid_thread (void)
{
if (ptid_equal (inferior_ptid, null_ptid)
|| is_exited (inferior_ptid))
error (_("\
Cannot execute this command without a live selected thread."));
}
/* If the user is looking at trace frames, any resumption of execution
is likely to mix up recorded and live target data. So simply
disallow those commands. */
void
ensure_not_tfind_mode (void)
{
if (get_traceframe_number () >= 0)
error (_("\
Cannot execute this command while looking at trace frames."));
}
void
continue_1 (int all_threads)
{
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
if (non_stop && all_threads)
{
/* Don't error out if the current thread is running, because
there may be other stopped threads. */
struct cleanup *old_chain;
/* Backup current thread and selected frame. */
old_chain = make_cleanup_restore_current_thread ();
iterate_over_threads (proceed_thread_callback, NULL);
/* Restore selected ptid. */
do_cleanups (old_chain);
}
else
{
2009-03-25 22:42:35 +01:00
ensure_valid_thread ();
ensure_not_running ();
clear_proceed_status ();
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
}
}
/* continue [-a] [proceed-count] [&] */
void
continue_command (char *args, int from_tty)
{
1999-07-07 22:19:36 +02:00
int async_exec = 0;
int all_threads = 0;
ERROR_NO_INFERIOR;
1999-07-05 19:58:44 +02:00
/* Find out whether we must run in the background. */
if (args != NULL)
async_exec = strip_bg_char (&args);
1999-07-05 19:58:44 +02:00
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
1999-07-07 22:19:36 +02:00
{
1999-07-05 19:58:44 +02:00
/* Simulate synchronous execution */
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
1999-07-05 19:58:44 +02:00
}
if (args != NULL)
{
if (strncmp (args, "-a", sizeof ("-a") - 1) == 0)
{
all_threads = 1;
args += sizeof ("-a") - 1;
if (*args == '\0')
args = NULL;
}
}
if (!non_stop && all_threads)
error (_("`-a' is meaningless in all-stop mode."));
if (args != NULL && all_threads)
error (_("\
Can't resume all threads and specify proceed count simultaneously."));
/* If we have an argument left, set proceed count of breakpoint we
stopped at. */
if (args != NULL)
{
bpstat bs = NULL;
int num, stat;
int stopped = 0;
struct thread_info *tp;
if (non_stop)
tp = find_thread_ptid (inferior_ptid);
else
{
ptid_t last_ptid;
struct target_waitstatus ws;
get_last_target_status (&last_ptid, &ws);
tp = find_thread_ptid (last_ptid);
}
if (tp != NULL)
bs = tp->stop_bpstat;
while ((stat = bpstat_num (&bs, &num)) != 0)
if (stat > 0)
{
set_ignore_count (num,
parse_and_eval_long (args) - 1,
from_tty);
/* set_ignore_count prints a message ending with a period.
So print two spaces before "Continuing.". */
if (from_tty)
printf_filtered (" ");
stopped = 1;
}
if (!stopped && from_tty)
{
printf_filtered
("Not stopped at any breakpoint; argument ignored.\n");
}
}
if (from_tty)
printf_filtered (_("Continuing.\n"));
continue_1 (all_threads);
}
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
/* Record the starting point of a "step" or "next" command. */
static void
set_step_frame (void)
{
struct symtab_and_line sal;
find_frame_sal (get_current_frame (), &sal);
set_step_info (get_current_frame (), sal);
}
/* Step until outside of current statement. */
static void
2000-07-30 03:48:28 +02:00
step_command (char *count_string, int from_tty)
{
step_1 (0, 0, count_string);
}
/* Likewise, but skip over subroutine calls as if single instructions. */
static void
2000-07-30 03:48:28 +02:00
next_command (char *count_string, int from_tty)
{
step_1 (1, 0, count_string);
}
/* Likewise, but step only one instruction. */
void
2000-07-30 03:48:28 +02:00
stepi_command (char *count_string, int from_tty)
{
step_1 (0, 1, count_string);
}
void
2000-07-30 03:48:28 +02:00
nexti_command (char *count_string, int from_tty)
{
step_1 (1, 1, count_string);
}
2000-05-22 11:02:23 +02:00
static void
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
delete_longjmp_breakpoint_cleanup (void *arg)
2000-05-22 11:02:23 +02:00
{
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
int thread = * (int *) arg;
delete_longjmp_breakpoint (thread);
2000-05-22 11:02:23 +02:00
}
static void
2000-07-30 03:48:28 +02:00
step_1 (int skip_subroutines, int single_inst, char *count_string)
{
int count = 1;
exec_cleanup murder. * 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.
2008-04-24 13:13:44 +02:00
struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
1999-07-05 19:58:44 +02:00
int async_exec = 0;
int thread = -1;
1999-07-07 22:19:36 +02:00
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
2009-03-25 22:42:35 +01:00
ensure_valid_thread ();
Non-stop inferior control. * infrun.c (resume): In non-stop mode, always resume just one thread. (proceed): Don't call prepare_to_proceed in non-stop mode. (fetch_inferior_event): In non-stop mode, switch context before handling the event. (error_is_running, ensure_not_running): New. (handle_inferior_event): In non-stop mode: Mark only the event thread as stopped. Require that the target module manages adding threads to the thread list. Assert that there isn't a deferred_step_ptid set. Don't switch to infwait_thread_hop_state. (normal_stop): Only mark not-running if inferior hasn't exited. In non-stop mode, only mark the event thread. * thread.c:Include "cli/cli-decode.h". (print_thread_info): Don't read from a running thread. Output "(running)" if thread is running. (switch_to_thread): Don't read stop_pc if thread is executing. (do_restore_current_thread_cleanup): Don't write to a running thread. (thread_apply_all_command): Don't read from a running thread. In non-stop mode, do a full context-switch instead of just switching threads. (thread_apply_command): In non-stop mode, do a full context-switch instead of just switching threads. (do_captured_thread_select): Likewise. Inform user if selected thread is running. (_initialize_thread): Mark "info threads" and "thread" and async_ok. * inf-loop.c (inferior_event_handler): In non-stop mode, don't unregister the target from the event loop. * infcmd.c (continue_command, step_1, jump_command) (signal_command): Ensure the selected thread isn't running. (interrupt_target_command): In non-stop mode, interrupt only the selected thread. * inferior.h (error_is_running, ensure_not_running): Declare. * target.h (struct target_ops): Add ptid argument to the to_stop member. (target_stop): Add ptid_t argument. * target.c (update_current_target): Add ptid argument to to_stop's type. (debug_to_stop): Add ptid_t argument. (debug_to_rcmd): Set to_stop_ptid. * remote.c (remote_stop): Add ptid_t argument. (async_remote_interrupt): Add inferior_ptid to target_stop. * inf-ptrace.c (inf_ptrace_stop): Add ptid argument. * Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
ensure_not_running ();
1999-07-05 19:58:44 +02:00
if (count_string)
async_exec = strip_bg_char (&count_string);
1999-07-07 22:19:36 +02:00
1999-07-05 19:58:44 +02:00
/* If we get a request for running in the bg but the target
doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
/* If we don't get a request of running in the bg, then we need
to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
1999-07-05 19:58:44 +02:00
{
/* Simulate synchronous execution */
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
1999-07-05 19:58:44 +02:00
}
count = count_string ? parse_and_eval_long (count_string) : 1;
1999-07-07 22:19:36 +02:00
if (!single_inst || skip_subroutines) /* leave si command alone */
{
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
if (in_thread_list (inferior_ptid))
thread = pid_to_thread_id (inferior_ptid);
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
set_longjmp_breakpoint (thread);
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
1999-12-07 04:56:43 +01:00
}
/* In synchronous case, all is well; each step_once call will step once. */
if (!target_can_async_p ())
1999-12-07 04:56:43 +01:00
{
for (; count > 0; count--)
{
struct thread_info *tp;
step_once (skip_subroutines, single_inst, count, thread);
1999-12-07 04:56:43 +01:00
if (target_has_execution
&& !ptid_equal (inferior_ptid, null_ptid))
tp = inferior_thread ();
1999-12-07 04:56:43 +01:00
else
tp = NULL;
if (!tp || !tp->stop_step || !tp->step_multi)
1999-12-07 04:56:43 +01:00
{
/* If we stopped for some reason that is not stepping
there are no further steps to make. */
if (tp)
tp->step_multi = 0;
break;
1999-12-07 04:56:43 +01:00
}
}
exec_cleanup murder. * 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.
2008-04-24 13:13:44 +02:00
do_cleanups (cleanups);
1999-12-07 04:56:43 +01:00
}
else
{
/* In the case of an asynchronous target things get complicated;
do only one step for now, before returning control to the
event loop. Let the continuation figure out how many other
steps we need to do, and handle them one at the time, through
step_once. */
step_once (skip_subroutines, single_inst, count, thread);
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
/* We are running, and the continuation is installed. It will
exec_cleanup murder. * 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.
2008-04-24 13:13:44 +02:00
disable the longjmp breakpoint as appropriate. */
discard_cleanups (cleanups);
}
1999-12-07 04:56:43 +01:00
}
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct step_1_continuation_args
{
int count;
int skip_subroutines;
int single_inst;
int thread;
};
1999-12-07 04:56:43 +01:00
/* Called after we are done with one step operation, to check whether
we need to step again, before we print the prompt and return control
to the user. If count is > 1, we will need to do one more call to
proceed(), via step_once(). Basically it is like step_once and
step_1_continuation are co-recursive. */
static void
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
step_1_continuation (void *args)
1999-12-07 04:56:43 +01:00
{
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct step_1_continuation_args *a = args;
if (target_has_execution)
{
struct thread_info *tp;
tp = inferior_thread ();
if (tp->step_multi && tp->stop_step)
{
/* There are more steps to make, and we did stop due to
ending a stepping range. Do another step. */
step_once (a->skip_subroutines, a->single_inst,
a->count - 1, a->thread);
return;
}
tp->step_multi = 0;
exec_cleanup murder. * 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.
2008-04-24 13:13:44 +02:00
}
/* We either stopped for some reason that is not stepping, or there
are no further steps to make. Cleanup. */
if (!a->single_inst || a->skip_subroutines)
delete_longjmp_breakpoint (a->thread);
1999-12-07 04:56:43 +01:00
}
/* Do just one step operation. This is useful to implement the 'step
n' kind of commands. In case of asynchronous targets, we will have
to set up a continuation to be done after the target stops (after
this one step). For synch targets, the caller handles further
stepping. */
static void
gdb/ * breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_address_is_meaningful): Claim bp_longjmp_resume as meaningful. (create_longjmp_breakpoint): Don't create bp_longjmp_resume breakpoints. Create bp_longjmp breakpoints as momentary breakpoints. (enable_longjmp_breakpoint): Delete. (set_longjmp_breakpoint): New. (disable_longjmp_breakpoint): Delete. (delete_longjmp_breakpoint): New. (set_longjmp_resume_breakpoint): Delete. (set_momentary_breakpoint_at_pc): New. (breakpoint_re_set_one): Don't delete bp_longjmp and bp_longjmp_resume breakpoints. (breakpoint_re_set): Don't create longjmp and longjmp-resume breakpoints. * infrun.c (step_resume_breakpoint): Add comment. (struct execution_control_state): Delete handling_longjmp member. (init_execution_control_state). Don't clear handling_longjmp. (context_switch): Don't context switch handling_longjmp. (handle_inferior_event): If handling a bp_longjmp breakpoint, create a bp_longjmp_resume breakpoint, and set it as current step_resume_breakpoint, then step over the longjmp breakpoint. If handling a bp_longjmp_resume breakpoint, don't delete the longjmp breakpoint, delete the longjmp-resume breakpoint, and stop stepping. (currently_stepping): Remove handling_longjmp from expression. (insert_step_resume_breakpoint_at_sal): Update comment. (insert_longjmp_resume_breakpoint): New. * breakpoint.h (set_momentary_breakpoint_at_pc): Declare. (enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete declarations. (set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare. (set_longjmp_resume_breakpoint): Delete declaration. * gdbthread.h (save_infrun_state): Remove handling_longjmp parameter. (load_infrun_state): Delete *handling_longjmp parameter. * thread.c (save_infrun_state): Remove handling_longjmp parameter. Update body. (load_infrun_state): Delete *handling_longjmp parameter. Update body. * infcmd.c (disable_longjmp_breakpoint_cleanup): Delete. (delete_longjmp_breakpoint_cleanup): New. (step_1): Call set_longjmp_breakpoint instead of enable_longjmp_breakpoint. Use delete_longjmp_breakpoint_cleanup instead of disable_longjmp_breakpoint_cleanup when making cleanup. (step_1_continuation): Pass thread id in the continuation args to step_once. (step_once): Add thread parameter. Pass thread id the the continuation. gdb/testsuite/ * gdb.cp/annota2.exp: Adjust to breakpoints invalidations at different times.
2008-05-04 21:39:00 +02:00
step_once (int skip_subroutines, int single_inst, int count, int thread)
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
{
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
struct frame_info *frame = get_current_frame ();
1999-12-07 04:56:43 +01:00
if (count > 0)
{
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
/* Don't assume THREAD is a valid thread id. It is set to -1 if
the longjmp breakpoint was not required. Use the
INFERIOR_PTID thread instead, which is the same thread when
THREAD is set. */
struct thread_info *tp = inferior_thread ();
clear_proceed_status ();
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
set_step_frame ();
1999-07-07 22:19:36 +02:00
if (!single_inst)
{
CORE_ADDR pc;
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
/* Step at an inlined function behaves like "down". */
if (!skip_subroutines && !single_inst
&& inline_skipped_frames (inferior_ptid))
{
step_into_inline_frame (inferior_ptid);
if (count > 1)
step_once (skip_subroutines, single_inst, count - 1, thread);
else
/* Pretend that we've stopped. */
normal_stop ();
return;
}
pc = get_frame_pc (frame);
find_pc_line_pc_range (pc,
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
&tp->step_range_start, &tp->step_range_end);
/* If we have no line info, switch to stepi mode. */
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
if (tp->step_range_end == 0 && step_stop_if_no_debug)
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
tp->step_range_start = tp->step_range_end = 1;
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
else if (tp->step_range_end == 0)
{
char *name;
if (find_pc_partial_function (pc, &name,
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
&tp->step_range_start,
&tp->step_range_end) == 0)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Cannot find bounds of current function"));
target_terminal_ours ();
printf_filtered (_("\
Single stepping until exit from function %s, \n\
which has no line number information.\n"), name);
}
}
else
{
/* Say we are stepping, but stop after one insn whatever it does. */
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
tp->step_range_start = tp->step_range_end = 1;
if (!skip_subroutines)
/* It is stepi.
Don't step over function calls, not even to functions lacking
line numbers. */
tp->step_over_calls = STEP_OVER_NONE;
}
if (skip_subroutines)
tp->step_over_calls = STEP_OVER_ALL;
Remove global continuations in favour of a per-thread 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.
2008-09-08 23:57:42 +02:00
tp->step_multi = (count > 1);
exec_cleanup murder. * 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.
2008-04-24 13:13:44 +02:00
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
/* For async targets, register a continuation to do any
additional steps. For sync targets, the caller will handle
further stepping. */
if (target_can_async_p ())
{
struct step_1_continuation_args *args;
args = xmalloc (sizeof (*args));
args->skip_subroutines = skip_subroutines;
args->single_inst = single_inst;
args->count = count;
args->thread = thread;
add_intermediate_continuation (tp, step_1_continuation, args, xfree);
}
}
}
1999-12-07 04:56:43 +01:00
/* Continue program at specified address. */
static void
2000-07-30 03:48:28 +02:00
jump_command (char *arg, int from_tty)
{
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR addr;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct symbol *fn;
struct symbol *sfn;
1999-07-05 19:58:44 +02:00
int async_exec = 0;
1999-07-07 22:19:36 +02:00
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
2009-03-25 22:42:35 +01:00
ensure_valid_thread ();
Non-stop inferior control. * infrun.c (resume): In non-stop mode, always resume just one thread. (proceed): Don't call prepare_to_proceed in non-stop mode. (fetch_inferior_event): In non-stop mode, switch context before handling the event. (error_is_running, ensure_not_running): New. (handle_inferior_event): In non-stop mode: Mark only the event thread as stopped. Require that the target module manages adding threads to the thread list. Assert that there isn't a deferred_step_ptid set. Don't switch to infwait_thread_hop_state. (normal_stop): Only mark not-running if inferior hasn't exited. In non-stop mode, only mark the event thread. * thread.c:Include "cli/cli-decode.h". (print_thread_info): Don't read from a running thread. Output "(running)" if thread is running. (switch_to_thread): Don't read stop_pc if thread is executing. (do_restore_current_thread_cleanup): Don't write to a running thread. (thread_apply_all_command): Don't read from a running thread. In non-stop mode, do a full context-switch instead of just switching threads. (thread_apply_command): In non-stop mode, do a full context-switch instead of just switching threads. (do_captured_thread_select): Likewise. Inform user if selected thread is running. (_initialize_thread): Mark "info threads" and "thread" and async_ok. * inf-loop.c (inferior_event_handler): In non-stop mode, don't unregister the target from the event loop. * infcmd.c (continue_command, step_1, jump_command) (signal_command): Ensure the selected thread isn't running. (interrupt_target_command): In non-stop mode, interrupt only the selected thread. * inferior.h (error_is_running, ensure_not_running): Declare. * target.h (struct target_ops): Add ptid argument to the to_stop member. (target_stop): Add ptid_t argument. * target.c (update_current_target): Add ptid argument to to_stop's type. (debug_to_stop): Add ptid_t argument. (debug_to_rcmd): Set to_stop_ptid. * remote.c (remote_stop): Add ptid_t argument. (async_remote_interrupt): Add inferior_ptid to target_stop. * inf-ptrace.c (inf_ptrace_stop): Add ptid argument. * Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
ensure_not_running ();
1999-07-05 19:58:44 +02:00
/* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
if (!arg)
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
error_no_arg (_("starting address"));
sals = decode_line_spec_1 (arg, 1);
if (sals.nelts != 1)
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Unreasonable jump request"));
}
sal = sals.sals[0];
2000-12-15 02:01:51 +01:00
xfree (sals.sals);
if (sal.symtab == 0 && sal.pc == 0)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("No source file has been specified."));
1999-07-07 22:19:36 +02:00
resolve_sal_pc (&sal); /* May error out */
/* See if we are trying to jump to another function. */
fn = get_frame_function (get_current_frame ());
sfn = find_pc_function (sal.pc);
if (fn != NULL && sfn != fn)
{
if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line,
2003-02-20 David Carlton <carlton@math.stanford.edu> * symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME; expand comment. * ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME. * ada-typeprint.c (ada_typedef_print): Ditto. * ax-gdb.c (gen_var_ref): Ditto. * breakpoint.c (print_one_breakpoint): Ditto. * buildsym.c (finish_block): Ditto. * c-valprint.c (c_val_print): Ditto. * expprint.c (print_subexp): Ditto. * findvar.c (locate_var_value): Ditto. * infcmd.c (jump_command): Ditto. * linespec.c (decode_line_2, decode_compound): Ditto. * maint.c (maintenance_translate_address): Ditto. * objc-lang.c (compare_selectors, compare_classes): Ditto. * printcmd.c (build_address_symbolic, sym_info, print_frame_args): Ditto. * p-valprint.c (pascal_val_print): Ditto. * stabsread.c (define_symbol): Ditto. * stack.c (print_frame, frame_info, print_block_frame_locals) (print_frame_arg_vars, return_command): Ditto. * symfile.c (compare_symbols, compare_psymbols): Ditto. * symmisc.c (print_symbol): Ditto. * symtab.c (lookup_partial_symbol, lookup_block_symbol) (compare_search_syms, print_symbol_info, print_msymbol_info) (rbreak_command): Ditto. * tracepoint.c (tracepoints_info): Ditto. * typeprint.c (typedef_print): Ditto. * valops.c (value_of_variable, hand_function_call): Ditto. * cli/cli-cmds.c (edit_command, list_command): Ditto. * ada-typeprint.c: Update Copyright. * infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto. * tracepoint.c, cli/cli-cmds.c: Ditto.
2003-02-20 18:17:25 +01:00
SYMBOL_PRINT_NAME (fn)))
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Not confirmed."));
/* NOTREACHED */
}
}
1999-07-07 22:19:36 +02:00
if (sfn != NULL)
{
fixup_symbol_section (sfn, 0);
* breakpoint.h (struct bp_location): Change type of section member to "struct obj_section *". * tracepoint.h (struct tracepoint): Likewise. * symtab.h (struct general_symbol_info): Replace bfd_section member with obj_section. (struct symtab_and_line): Change type of section member to "struct obj_section *". (SYMBOL_BFD_SECTION): Remove macro, replace by ... (SYMBOL_OBJ_SECTION): ... this. * minsym.c (prim_record_minimal_symbol_and_info): Record symbol section as obj_section instead of bfd_section. * ada-lang.c (ada_decode_symbol): Use gsymbol->obj_section directly instead of looking of obj_section from bfd_section. * objfiles.h (find_pc_sect_section): Remove. * objfiles.c (find_pc_sect_section): Remove. (find_pc_section): Inline find_pc_sect_section code. * symfile.h (find_pc_overlay): Return struct obj_section *. (find_pc_mapped_section): Likewise. (section_is_overlay, section_is_mapped): Change type of section argument to struct obj_section *. (pc_in_mapped_range, pc_in_unmapped_range): Likewise. (overlay_mapped_address, overlay_unmapped_address): Likewise. (symbol_overlayed_address): Likewise. * symtab.h (symbol_overlayed_address): Likewise. * symfile.c (overlay_is_mapped): Remove. (section_is_mapped): Inline overlay_is_mapped code. Update. (overlay_invalidate_all): Update. (section_is_overlay): Change section argument to type "struct obj_section *". Use bfd_ methods. (pc_in_unmapped_range): Likewise. Handle relocated sections. (pc_in_mapped_range): Likewise. Handle relocated sections. (sections_overlap): Likewise. (overlay_unmapped_address): Likewise. (overlay_mapped_address): Likewise. (symbol_overlayed_address): Likewise. (find_pc_overlay): Return struct obj_section *. (find_pc_mapped_section): Likewise. (list_overlays_command): Update. (map_overlay_command, unmap_overlay_command): Update. (simple_overlay_update): Update. * block.h (blockvector_for_pc_sect): Change section argument to type "struct obj_section *". (block_for_pc_sect): Likewise. * block.c (blockvector_for_pc_sect): Change section argument to type "struct obj_section *". (block_for_pc_sect): Likewise. * symtab.h (find_pc_sect_function, find_pc_sect_psymtab, find_pc_sect_symtab, find_pc_sect_psymbol, find_pc_sect_line, lookup_minimal_symbol_by_pc_section, find_function_start_pc): Likewise. (matching_bfd_sections): Rename to ... (matching_obj_sections): ... this. Update argument types. * blockframe.c (find_pc_sect_function): Likewise. * breakpoint.c (describe_other_breakpoints): Likewise. (breakpoint_has_pc, check_duplicates_for): Likewise. * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Likewise. (lookup_minimal_symbol_by_pc_section): Likewise. * symtab.c (find_pc_sect_psymtab_closer): Likewise. (find_pc_sect_psymtab, find_pc_sect_psymbol, find_pc_sect_symtab, find_pc_sect_line, find_function_start_pc): Likewise. (matching_bfd_sections): Rename to ... (matching_obj_sections): ... this. Update argument types. * blockframe.c (find_pc_partial_function): Update to section type changes. No longer call find_pc_sect_section. (cache_pc_function_section): Change to type "struct obj_section *". * breakpoint.c (resolve_sal_pc): Update to section type changes. * exec.c (xfer_memory): Likewise. * findvar.c (read_var_value): Likewise. * infcmd.c (jump_command): Likewise. * linespec.c (minsym_found): Likewise. * maint.c (maintenance_translate_address): Likewise. * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Likewise. (lookup_solib_trampoline_symbol_by_pc): Likewise. * parse.c (write_exp_msymbol): Likewise. * printcmd.c (build_address_symbolic): Likewise. (address_info, sym_info): Likewise. * symmisc.c (dump_msymbols, print_symbol): Likewise. * symtab.c (fixup_section): Likewise. (fixup_symbol_section, fixup_psymbol_section): Likewise. (find_pc_line, find_function_start_sal): Likewise. * target.c (memory_xfer_partial): Likewise. * hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline): Likewise. * spu-tdep.c (spu_overlay_update): Likewise.
2008-09-05 13:37:18 +02:00
if (section_is_overlay (SYMBOL_OBJ_SECTION (sfn)) &&
!section_is_mapped (SYMBOL_OBJ_SECTION (sfn)))
{
if (!query (_("WARNING!!! Destination is in unmapped overlay! Jump anyway? ")))
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Not confirmed."));
/* NOTREACHED */
}
}
}
addr = sal.pc;
if (from_tty)
{
printf_filtered (_("Continuing at "));
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
printf_filtered (".\n");
}
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
/* Simulate synchronous execution */
async_disable_stdin ();
}
clear_proceed_status ();
proceed (addr, TARGET_SIGNAL_0, 0);
}
1999-07-07 22:19:36 +02:00
/* Go to line or address in current procedure */
static void
2000-07-30 03:48:28 +02:00
go_command (char *line_no, int from_tty)
{
1999-07-07 22:19:36 +02:00
if (line_no == (char *) NULL || !*line_no)
printf_filtered (_("Usage: go <location>\n"));
else
{
1999-05-05 16:45:51 +02:00
tbreak_command (line_no, from_tty);
jump_command (line_no, from_tty);
}
}
1999-07-07 22:19:36 +02:00
/* Continue program giving it specified signal. */
static void
2000-07-30 03:48:28 +02:00
signal_command (char *signum_exp, int from_tty)
{
enum target_signal oursig;
int async_exec = 0;
dont_repeat (); /* Too dangerous. */
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
2009-03-25 22:42:35 +01:00
ensure_valid_thread ();
Non-stop inferior control. * infrun.c (resume): In non-stop mode, always resume just one thread. (proceed): Don't call prepare_to_proceed in non-stop mode. (fetch_inferior_event): In non-stop mode, switch context before handling the event. (error_is_running, ensure_not_running): New. (handle_inferior_event): In non-stop mode: Mark only the event thread as stopped. Require that the target module manages adding threads to the thread list. Assert that there isn't a deferred_step_ptid set. Don't switch to infwait_thread_hop_state. (normal_stop): Only mark not-running if inferior hasn't exited. In non-stop mode, only mark the event thread. * thread.c:Include "cli/cli-decode.h". (print_thread_info): Don't read from a running thread. Output "(running)" if thread is running. (switch_to_thread): Don't read stop_pc if thread is executing. (do_restore_current_thread_cleanup): Don't write to a running thread. (thread_apply_all_command): Don't read from a running thread. In non-stop mode, do a full context-switch instead of just switching threads. (thread_apply_command): In non-stop mode, do a full context-switch instead of just switching threads. (do_captured_thread_select): Likewise. Inform user if selected thread is running. (_initialize_thread): Mark "info threads" and "thread" and async_ok. * inf-loop.c (inferior_event_handler): In non-stop mode, don't unregister the target from the event loop. * infcmd.c (continue_command, step_1, jump_command) (signal_command): Ensure the selected thread isn't running. (interrupt_target_command): In non-stop mode, interrupt only the selected thread. * inferior.h (error_is_running, ensure_not_running): Declare. * target.h (struct target_ops): Add ptid argument to the to_stop member. (target_stop): Add ptid_t argument. * target.c (update_current_target): Add ptid argument to to_stop's type. (debug_to_stop): Add ptid_t argument. (debug_to_rcmd): Set to_stop_ptid. * remote.c (remote_stop): Add ptid_t argument. (async_remote_interrupt): Add inferior_ptid to target_stop. * inf-ptrace.c (inf_ptrace_stop): Add ptid argument. * Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
ensure_not_running ();
/* Find out whether we must run in the background. */
if (signum_exp != NULL)
async_exec = strip_bg_char (&signum_exp);
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
/* Simulate synchronous execution. */
async_disable_stdin ();
}
if (!signum_exp)
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
error_no_arg (_("signal number"));
/* It would be even slicker to make signal names be valid expressions,
(the type could be "enum $signal" or some such), then the user could
assign them to convenience variables. */
oursig = target_signal_from_name (signum_exp);
if (oursig == TARGET_SIGNAL_UNKNOWN)
{
/* No, try numeric. */
int num = parse_and_eval_long (signum_exp);
if (num == 0)
oursig = TARGET_SIGNAL_0;
else
oursig = target_signal_from_command (num);
}
if (from_tty)
{
if (oursig == TARGET_SIGNAL_0)
printf_filtered (_("Continuing with no signal.\n"));
else
printf_filtered (_("Continuing with signal %s.\n"),
target_signal_to_name (oursig));
}
clear_proceed_status ();
proceed ((CORE_ADDR) -1, oursig, 0);
}
/* Proceed until we reach a different source line with pc greater than
our current one or exit the function. We skip calls in both cases.
Note that eventually this command should probably be changed so
that only source lines are printed out when we hit the breakpoint
we set. This may involve changes to wait_for_inferior and the
proceed status code. */
static void
2000-07-30 03:48:28 +02:00
until_next_command (int from_tty)
{
struct frame_info *frame;
CORE_ADDR pc;
struct symbol *func;
struct symtab_and_line sal;
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
struct thread_info *tp = inferior_thread ();
1999-07-07 22:19:36 +02:00
clear_proceed_status ();
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
set_step_frame ();
frame = get_current_frame ();
/* Step until either exited from this function or greater
than the current line (if in symbolic section) or pc (if
not). */
pc = get_frame_pc (frame);
func = find_pc_function (pc);
1999-07-07 22:19:36 +02:00
if (!func)
{
struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc);
1999-07-07 22:19:36 +02:00
if (msymbol == NULL)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Execution is not within a known function."));
1999-07-07 22:19:36 +02:00
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
tp->step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
tp->step_range_end = pc;
}
else
{
sal = find_pc_line (pc, 0);
1999-07-07 22:19:36 +02:00
Remove context switching in favour of accessing thread_info fields directly. * infrun.c (stepping_over_breakpoint, step_resume_breakpoint): Delete. (struct thread_stepping_state): Delete. (gtss, tss): Delete. (follow_inferior_reset_breakpoints, follow_exec) (resume, clear_proceed_status): Adjust. (prev_pc): Delete. (proceed, start_remote, init_wait_for_inferior): Adjust. (struct execution_control_state): Add event_thread member. (delete_step_resume_breakpoint_callback) (delete_step_thread_step_resume_breakpoint) (delete_step_thread_step_resume_breakpoint_cleanup) (delete_step_thread_step_resume_breakpoint): New. (wait_for_inferior, init_execution_control_state): Use delete_step_thread_step_resume_breakpoint_cleanup. (wait_for_inferior): Set the event_thread. (fetch_inferior_event): Ditto. Delete the step-resume breakpoint with delete_step_thread_step_resume_breakpoint. (init_thread_stepping_state): Change parameter type to thread_info. Adjust. (context_switch): Don't context switch prev_pc, stepping_over_breakpoint, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, tss->stepping_over_breakpoint, tss->stepping_through_solib_after_catch, tss->stepping_through_solib_catchpoints, tss->current_line, or tss->current_symtab. (adjust_pc_after_break, handle_inferior_event) (currently_stepping, step_into_function) (insert_step_resume_breakpoint_at_sal) (insert_longjmp_resume_breakpoint, keep_going): Adjust. (clear_stepping_state): New. (normal_stop): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * gdbthread.h (struct thread_info): Comments describing the members moved here. Add step_after_step_resume_breakpoint. (delete_step_resume_breakpoint): Add thread_info argument. (save_infrun_state, load_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, another_trap, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab function arguments. (inferior_thread): Declare. * thread.c (inferior_thread): New. (delete_step_resume_breakpoint): Add a thread_info parameter and rewrite. (load_infrun_state, save_infrun_state): Remove prev_pc, trap_expected, step_resume_breakpoint, step_range_start, step_range_end, step_frame_id, stepping_over_breakpoint, stepping_through_solib_after_catch, stepping_through_solib_catchpoints, current_line and current_symtab args. Remove code referencing them. * infcmd.c (step_range_start, step_range_end, step_frame_id): Delete. (step_1, step_once, until_next_command): Adjust. * inferior.h (step_range_start, step_range_end, step_frame_id): Delete. * linux-nat.c (linux_child_follow_fork): If following the child, move the step state to it. Adjust. * inf-ptrace.c (inf_ptrace_follow_fork): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
2008-09-08 23:40:39 +02:00
tp->step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
tp->step_range_end = sal.end;
}
1999-07-07 22:19:36 +02:00
tp->step_over_calls = STEP_OVER_ALL;
tp->step_multi = 0; /* Only one call to proceed */
1999-07-07 22:19:36 +02:00
1999-10-06 01:13:56 +02:00
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
}
1999-07-07 22:19:36 +02:00
static void
2000-07-30 03:48:28 +02:00
until_command (char *arg, int from_tty)
{
1999-07-05 19:58:44 +02:00
int async_exec = 0;
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
1999-07-05 19:58:44 +02:00
/* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
1999-07-07 22:19:36 +02:00
{
1999-07-05 19:58:44 +02:00
/* Simulate synchronous execution */
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
1999-07-05 19:58:44 +02:00
}
if (arg)
until_break_command (arg, from_tty, 0);
else
until_next_command (from_tty);
}
static void
advance_command (char *arg, int from_tty)
{
int async_exec = 0;
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
if (arg == NULL)
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
error_no_arg (_("a location"));
/* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
/* Simulate synchronous execution. */
async_disable_stdin ();
}
until_break_command (arg, from_tty, 1);
}
/* Print the result of a function at the end of a 'finish' command. */
1999-11-09 02:23:30 +01:00
static void
doc/ChangeLog: -------------- * gdb.texinfo (Set SH Calling convention): New @item. (Show SH Calling convention): Ditto. ChangeLog: ---------- * NEWS: Add information on calling convention and new SH CLI options. * sh-tdep.c (sh_cc_gcc): New static string. (sh_cc_renesas): Ditto. (sh_cc_enum): New static string array. (sh_active_calling_convention): New static string pointer denoting active user chosen ABI. (sh_is_renesas_calling_convention): New function to return function specific ABI, or user choice if necessary. (sh_use_struct_convention): Rename first argument and turn around its meaning. Check for renesas ABI and return accordingly. (sh_use_struct_convention_nofpu): New function. (sh_next_flt_argreg): Get function type as third parameter. Check for renesas ABI and choose floating registers accordingly. (sh_push_dummy_call_fpu): Check for ABI and choose argument slot and struct return slot accordingly. (sh_push_dummy_call_nofpu): Ditto. (sh_return_value_nofpu): Call sh_use_struct_convention_nofpu from here. Evaluate ABI and give to sh_use_struct_convention_nofpu. (sh_return_value_fpu): Evaluate ABI and give to sh_use_struct_convention. (show_sh_command): New function. (set_sh_command): Ditto. (_initialize_sh_tdep): Initialize `set/show sh calling-convention CLI command. * gdbarch.sh (return_value): Add func_type argument. * gdbarch.c: Regenerate. * gdbarch.h: Ditto. * eval.c (evaluate_subexp_standard): Rename local variable value_type to val_type so as not to collide with value_type function. Call using_struct_return with additional function type argument. * infcall.c (call_function_by_hand): Call using_struct_return and gdbarch_return_value with additional function type argument. * infcmd.c (print_return_value): Take addition func_type argument. Call gdbarch_return_value with additional function type argument. (finish_command_continuation): Call print_return_value with additional function type argument. (finish_command): Ditto. * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with additional function type argument. * stack.c (return_command): Call using_struct_return and gdbarch_return_value with additional function type argument. * value.c (using_struct_return): Take additional function type argument. * value.h (using_struct_return): Accommodate declaration. * alpha-tdep.c (alpha_return_value): Add func_type argument. * amd64-tdep.c (amd64_return_value): Ditto. * arm-tdep.c (arm_return_value): Ditto. * avr-tdep.c (avr_return_value): Ditto. * cris-tdep.c (cris_return_value): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_return_value): Ditto. (h8300h_return_value): Ditto. * hppa-tdep.c (hppa32_return_value): Ditto. (hppa64_return_value): Ditto. * i386-tdep.c (i386_return_value): Ditto. * ia64-tdep.c (ia64_return_value): Ditto. * iq2000-tdep.c (iq2000_return_value): Ditto. * m32c-tdep.c (m32c_return_value): Ditto. * m32r-tdep.c (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_return_value): Ditto. * m68k-tdep.c (m68k_return_value): Ditto. (m68k_svr4_return_value): Ditto. * m88k-tdep.c (m88k_return_value): Ditto. * mep-tdep.c (mep_return_value): Ditto. * mips-tdep.c (mips_eabi_return_value): Ditto. (mips_n32n64_return_value): Ditto. (mips_o32_return_value): Ditto. (mips_o64_return_value): Ditto. * mn10300-tdep.c (mn10300_return_value): Ditto. * mt-tdep.c (mt_return_value): Ditto. * ppc-linux-tdep.c (ppc_linux_return_value): Ditto. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto. * rs6000-tdep.c (rs6000_return_value): Ditto. * s390-tdep.c (s390_return_value): Ditto. * score-tdep.c (score_return_value): Ditto. * sh-tdep.c (sh_return_value_nofpu): Ditto. (sh_return_value_fpu): Ditto. * sh64-tdep.c (sh64_return_value): Ditto. * sparc-tdep.c (sparc32_return_value): Ditto. * sparc64-tdep.c (sparc64_return_value): Ditto. * spu-tdep.c (spu_return_value): Ditto. * v850-tdep.c (v850_return_value): Ditto. * vax-tdep.c (vax_return_value): Ditto. * xstormy16-tdep.c (xstormy16_return_value): Ditto. * xtensa-tdep.c (xtensa_return_value): Ditto. * gdbtypes.h (struct type): Add calling_convention member. * dwarf2read.c (read_subroutine_type): Add calling convention read from DW_AT_calling_convention attribute to function type.
2008-04-22 13:03:42 +02:00
print_return_value (struct type *func_type, struct type *value_type)
1999-11-09 02:23:30 +01:00
{
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
struct gdbarch *gdbarch = get_regcache_arch (stop_registers);
struct cleanup *old_chain;
struct ui_stream *stb;
struct value *value;
CHECK_TYPEDEF (value_type);
gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
1999-11-09 02:23:30 +01:00
/* FIXME: 2003-09-27: When returning from a nested inferior function
call, it's possible (with no help from the architecture vector)
to locate and return/print a "struct return" value. This is just
a more complicated case of what is already being done in in the
inferior function call code. In fact, when inferior function
calls are made async, this will likely be made the norm. */
doc/ChangeLog: -------------- * gdb.texinfo (Set SH Calling convention): New @item. (Show SH Calling convention): Ditto. ChangeLog: ---------- * NEWS: Add information on calling convention and new SH CLI options. * sh-tdep.c (sh_cc_gcc): New static string. (sh_cc_renesas): Ditto. (sh_cc_enum): New static string array. (sh_active_calling_convention): New static string pointer denoting active user chosen ABI. (sh_is_renesas_calling_convention): New function to return function specific ABI, or user choice if necessary. (sh_use_struct_convention): Rename first argument and turn around its meaning. Check for renesas ABI and return accordingly. (sh_use_struct_convention_nofpu): New function. (sh_next_flt_argreg): Get function type as third parameter. Check for renesas ABI and choose floating registers accordingly. (sh_push_dummy_call_fpu): Check for ABI and choose argument slot and struct return slot accordingly. (sh_push_dummy_call_nofpu): Ditto. (sh_return_value_nofpu): Call sh_use_struct_convention_nofpu from here. Evaluate ABI and give to sh_use_struct_convention_nofpu. (sh_return_value_fpu): Evaluate ABI and give to sh_use_struct_convention. (show_sh_command): New function. (set_sh_command): Ditto. (_initialize_sh_tdep): Initialize `set/show sh calling-convention CLI command. * gdbarch.sh (return_value): Add func_type argument. * gdbarch.c: Regenerate. * gdbarch.h: Ditto. * eval.c (evaluate_subexp_standard): Rename local variable value_type to val_type so as not to collide with value_type function. Call using_struct_return with additional function type argument. * infcall.c (call_function_by_hand): Call using_struct_return and gdbarch_return_value with additional function type argument. * infcmd.c (print_return_value): Take addition func_type argument. Call gdbarch_return_value with additional function type argument. (finish_command_continuation): Call print_return_value with additional function type argument. (finish_command): Ditto. * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with additional function type argument. * stack.c (return_command): Call using_struct_return and gdbarch_return_value with additional function type argument. * value.c (using_struct_return): Take additional function type argument. * value.h (using_struct_return): Accommodate declaration. * alpha-tdep.c (alpha_return_value): Add func_type argument. * amd64-tdep.c (amd64_return_value): Ditto. * arm-tdep.c (arm_return_value): Ditto. * avr-tdep.c (avr_return_value): Ditto. * cris-tdep.c (cris_return_value): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_return_value): Ditto. (h8300h_return_value): Ditto. * hppa-tdep.c (hppa32_return_value): Ditto. (hppa64_return_value): Ditto. * i386-tdep.c (i386_return_value): Ditto. * ia64-tdep.c (ia64_return_value): Ditto. * iq2000-tdep.c (iq2000_return_value): Ditto. * m32c-tdep.c (m32c_return_value): Ditto. * m32r-tdep.c (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_return_value): Ditto. * m68k-tdep.c (m68k_return_value): Ditto. (m68k_svr4_return_value): Ditto. * m88k-tdep.c (m88k_return_value): Ditto. * mep-tdep.c (mep_return_value): Ditto. * mips-tdep.c (mips_eabi_return_value): Ditto. (mips_n32n64_return_value): Ditto. (mips_o32_return_value): Ditto. (mips_o64_return_value): Ditto. * mn10300-tdep.c (mn10300_return_value): Ditto. * mt-tdep.c (mt_return_value): Ditto. * ppc-linux-tdep.c (ppc_linux_return_value): Ditto. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto. * rs6000-tdep.c (rs6000_return_value): Ditto. * s390-tdep.c (s390_return_value): Ditto. * score-tdep.c (score_return_value): Ditto. * sh-tdep.c (sh_return_value_nofpu): Ditto. (sh_return_value_fpu): Ditto. * sh64-tdep.c (sh64_return_value): Ditto. * sparc-tdep.c (sparc32_return_value): Ditto. * sparc64-tdep.c (sparc64_return_value): Ditto. * spu-tdep.c (spu_return_value): Ditto. * v850-tdep.c (v850_return_value): Ditto. * vax-tdep.c (vax_return_value): Ditto. * xstormy16-tdep.c (xstormy16_return_value): Ditto. * xtensa-tdep.c (xtensa_return_value): Ditto. * gdbtypes.h (struct type): Add calling_convention member. * dwarf2read.c (read_subroutine_type): Add calling convention read from DW_AT_calling_convention attribute to function type.
2008-04-22 13:03:42 +02:00
switch (gdbarch_return_value (gdbarch, func_type, value_type,
NULL, NULL, NULL))
{
case RETURN_VALUE_REGISTER_CONVENTION:
case RETURN_VALUE_ABI_RETURNS_ADDRESS:
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
value = allocate_value (value_type);
doc/ChangeLog: -------------- * gdb.texinfo (Set SH Calling convention): New @item. (Show SH Calling convention): Ditto. ChangeLog: ---------- * NEWS: Add information on calling convention and new SH CLI options. * sh-tdep.c (sh_cc_gcc): New static string. (sh_cc_renesas): Ditto. (sh_cc_enum): New static string array. (sh_active_calling_convention): New static string pointer denoting active user chosen ABI. (sh_is_renesas_calling_convention): New function to return function specific ABI, or user choice if necessary. (sh_use_struct_convention): Rename first argument and turn around its meaning. Check for renesas ABI and return accordingly. (sh_use_struct_convention_nofpu): New function. (sh_next_flt_argreg): Get function type as third parameter. Check for renesas ABI and choose floating registers accordingly. (sh_push_dummy_call_fpu): Check for ABI and choose argument slot and struct return slot accordingly. (sh_push_dummy_call_nofpu): Ditto. (sh_return_value_nofpu): Call sh_use_struct_convention_nofpu from here. Evaluate ABI and give to sh_use_struct_convention_nofpu. (sh_return_value_fpu): Evaluate ABI and give to sh_use_struct_convention. (show_sh_command): New function. (set_sh_command): Ditto. (_initialize_sh_tdep): Initialize `set/show sh calling-convention CLI command. * gdbarch.sh (return_value): Add func_type argument. * gdbarch.c: Regenerate. * gdbarch.h: Ditto. * eval.c (evaluate_subexp_standard): Rename local variable value_type to val_type so as not to collide with value_type function. Call using_struct_return with additional function type argument. * infcall.c (call_function_by_hand): Call using_struct_return and gdbarch_return_value with additional function type argument. * infcmd.c (print_return_value): Take addition func_type argument. Call gdbarch_return_value with additional function type argument. (finish_command_continuation): Call print_return_value with additional function type argument. (finish_command): Ditto. * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with additional function type argument. * stack.c (return_command): Call using_struct_return and gdbarch_return_value with additional function type argument. * value.c (using_struct_return): Take additional function type argument. * value.h (using_struct_return): Accommodate declaration. * alpha-tdep.c (alpha_return_value): Add func_type argument. * amd64-tdep.c (amd64_return_value): Ditto. * arm-tdep.c (arm_return_value): Ditto. * avr-tdep.c (avr_return_value): Ditto. * cris-tdep.c (cris_return_value): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_return_value): Ditto. (h8300h_return_value): Ditto. * hppa-tdep.c (hppa32_return_value): Ditto. (hppa64_return_value): Ditto. * i386-tdep.c (i386_return_value): Ditto. * ia64-tdep.c (ia64_return_value): Ditto. * iq2000-tdep.c (iq2000_return_value): Ditto. * m32c-tdep.c (m32c_return_value): Ditto. * m32r-tdep.c (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_return_value): Ditto. * m68k-tdep.c (m68k_return_value): Ditto. (m68k_svr4_return_value): Ditto. * m88k-tdep.c (m88k_return_value): Ditto. * mep-tdep.c (mep_return_value): Ditto. * mips-tdep.c (mips_eabi_return_value): Ditto. (mips_n32n64_return_value): Ditto. (mips_o32_return_value): Ditto. (mips_o64_return_value): Ditto. * mn10300-tdep.c (mn10300_return_value): Ditto. * mt-tdep.c (mt_return_value): Ditto. * ppc-linux-tdep.c (ppc_linux_return_value): Ditto. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto. * rs6000-tdep.c (rs6000_return_value): Ditto. * s390-tdep.c (s390_return_value): Ditto. * score-tdep.c (score_return_value): Ditto. * sh-tdep.c (sh_return_value_nofpu): Ditto. (sh_return_value_fpu): Ditto. * sh64-tdep.c (sh64_return_value): Ditto. * sparc-tdep.c (sparc32_return_value): Ditto. * sparc64-tdep.c (sparc64_return_value): Ditto. * spu-tdep.c (spu_return_value): Ditto. * v850-tdep.c (v850_return_value): Ditto. * vax-tdep.c (vax_return_value): Ditto. * xstormy16-tdep.c (xstormy16_return_value): Ditto. * xtensa-tdep.c (xtensa_return_value): Ditto. * gdbtypes.h (struct type): Add calling_convention member. * dwarf2read.c (read_subroutine_type): Add calling convention read from DW_AT_calling_convention attribute to function type.
2008-04-22 13:03:42 +02:00
gdbarch_return_value (gdbarch, func_type, value_type, stop_registers,
value_contents_raw (value), NULL);
break;
case RETURN_VALUE_STRUCT_CONVENTION:
value = NULL;
break;
default:
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
internal_error (__FILE__, __LINE__, _("bad switch"));
}
if (value)
{
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
struct value_print_options opts;
/* Print it. */
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
record_latest_value (value));
ui_out_text (uiout, " = ");
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
get_raw_print_options (&opts);
value_print (value, stb->stream, &opts);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
do_cleanups (old_chain);
}
else
{
ui_out_text (uiout, "Value returned has type: ");
ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
ui_out_text (uiout, ".");
ui_out_text (uiout, " Cannot determine contents\n");
}
1999-11-09 02:23:30 +01:00
}
1999-07-05 19:58:44 +02:00
/* Stuff that needs to be done by the finish command after the target
has stopped. In asynchronous mode, we wait for the target to stop
in the call to poll or select in the event loop, so it is
impossible to do all the stuff as part of the finish_command
function itself. The only chance we have to complete this command
is in fetch_inferior_event, which is called by the event loop as
soon as it detects that the target has stopped. This function is
called via the cmd_continuation pointer. */
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct finish_command_continuation_args
1999-07-05 19:58:44 +02:00
{
struct breakpoint *breakpoint;
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct symbol *function;
};
1999-07-07 22:19:36 +02:00
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
static void
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
finish_command_continuation (void *arg)
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
{
struct finish_command_continuation_args *a = arg;
struct thread_info *tp = NULL;
bpstat bs = NULL;
if (!ptid_equal (inferior_ptid, null_ptid)
&& target_has_execution
&& is_stopped (inferior_ptid))
{
tp = inferior_thread ();
bs = tp->stop_bpstat;
}
if (bpstat_find_breakpoint (bs, a->breakpoint) != NULL
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
&& a->function != NULL)
1999-07-05 19:58:44 +02:00
{
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
struct type *value_type;
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (a->function));
if (!value_type)
internal_error (__FILE__, __LINE__,
_("finish_command: function has no target type"));
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
if (TYPE_CODE (value_type) != TYPE_CODE_VOID)
{
volatile struct gdb_exception ex;
TRY_CATCH (ex, RETURN_MASK_ALL)
{
/* print_return_value can throw an exception in some
circumstances. We need to catch this so that we still
delete the breakpoint. */
print_return_value (SYMBOL_TYPE (a->function), value_type);
}
if (ex.reason < 0)
exception_print (gdb_stdout, ex);
}
1999-07-05 19:58:44 +02:00
}
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
/* We suppress normal call of normal_stop observer and do it here so
that the *stopped notification includes the return value. */
if (bs != NULL && tp->proceed_to_finish)
observer_notify_normal_stop (bs, 1 /* print frame */);
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
delete_breakpoint (a->breakpoint);
1999-07-05 19:58:44 +02:00
}
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
static void
finish_command_continuation_free_arg (void *arg)
{
xfree (arg);
}
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
/* finish_backward -- helper function for finish_command. */
static void
finish_backward (struct symbol *function)
{
struct symtab_and_line sal;
struct thread_info *tp = inferior_thread ();
struct breakpoint *breakpoint;
struct cleanup *old_chain;
CORE_ADDR pc;
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
CORE_ADDR func_addr;
int back_up;
pc = get_frame_pc (get_current_frame ());
if (find_pc_partial_function (pc, NULL, &func_addr, NULL) == 0)
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
internal_error (__FILE__, __LINE__,
_("Finish: couldn't find function."));
sal = find_pc_line (func_addr, 0);
/* We don't need a return value. */
tp->proceed_to_finish = 0;
/* Special case: if we're sitting at the function entry point,
then all we need to do is take a reverse singlestep. We
don't need to set a breakpoint, and indeed it would do us
no good to do so.
Note that this can only happen at frame #0, since there's
no way that a function up the stack can have a return address
that's equal to its entry point. */
if (sal.pc != pc)
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
{
* breakpoint.h (struct breakpoint): New member GDBARCH. * breakpoint.c: Include "arch-utils.h". (set_raw_breakpoint_without_location): Add GDBARCH parameter. Use it to set breakpoint architecture. (set_raw_breakpoint): Add GDBARCH parameter. (create_internal_breakpoint): Likewise. (create_catchpoint): Likewise. (create_fork_vfork_event_catchpoint): Likewise. (create_breakpoint): Likewise. (create_breakpoints): Likewise. (break_command_really): Likewise. (create_ada_exception_breakpoint): Likewise. Update local callers to pass architecture: (create_internal_breakpoint): Update. (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_thread_event_breakpoint): Update. (create_solib_event_breakpoint): Update. (create_catchpoint): Update. (create_fork_vfork_event_catchpoint): Update. (set_momentary_breakpoint): Update. (clone_momentary_breakpoint): Update. (create_breakpoint): Update. (create_breakpoints): Update. (break_command_really): Update. (break_command_1): Update. (set_breakpoint): Update. (watch_command_1): Update. (catch_fork_command_1): Update. (catch_exec_commnd_1): Update. (handle_gnu_v3_exceptions): Update. (create_ada_exception_breakpoint): Update. (catch_ada_exception_command): Update. (catch_assert_command): Update. (trace_command): Update. * breakpoint.h (struct bp_location): New member GDBARCH. * breakpoint.c (get_sal_arch): New function. (set_raw_breakpoint): Set location architecture. (add_location_to_breakpoint): Likewise. (clone_momentary_breakpoint): Likewise. (watch_command_1): Likewise. (update_watchpoint): Likewise. (bp_loc_is_permanent): Use location architecture instead of current_gdbarch. (adjust_breakpoint_address): Add GDBARCH parameter; use it instead of current_gdbarch. Update callers of adjust_breakpoint_address to pass breakpoint location architecture: (set_raw_breakpoint): Update. (watch_command_1): Update. * tracepoint.c: (collect_symbol): Add GDBARCH parameter, use instead of current_gdbarch. (add_local_symbols): Add GDBARCH parameter. Pass to collect_symbol. (encode_actions): Pass tracepoint architecture to add_local_symbols (encode_actions): Use tracepoint architecture instead of current_gdbarch. Pass it to add_local_symbols and collect_symbol. * breakpoint.h (struct breakpoint_ops): Replace last_addr parameter of print_one callback with last_loc. * breakpoint.c (print_one_breakpoint_location): Replace last_addr parameter with last_loc. (print_one_breakpoint): Likewise. (do_captured_breakpoint_query): Update call. (breakpoint_1): Pass last_loc instead of last_addr to print_one_breakpoint. Pass last location architecture instead of current_gdbarch to set_next_address. Update all implementations of the print_one callback: * breakpoint.c (print_one_catch_fork): Update. (print_one_catch_vfork): Update. (print_one_catch_exec): Update. (print_one_exception_catchpoint): Update. * ada-lang.c (print_one_exception): Update. (print_one_catch_exception): Update. (print_one_catch_exception_unhandled): Update. (print_one_catch_assert): Update. * breakpoint.c (print_one_breakpoint_location): Add PRINT_ADDRESS_BITS parameter. Use it instead of gdbarch_addr_bit (current_gdbarch). (print_one_breakpoint): Add PRINT_ADDRESS_BITS parameter and pass it to print_one_breakpoint_location. (breakpoint_address_bits): New function. (do_captured_breakpoint_query): Compute number of address bits to print and pass it to print_one_breakpoint. (breakpoint_1): Likewise. Use it instead of current_gdbarch. * breakpoint.h (create_thread_event_breakpoint): Add GDBARCH. * breakpoint.c (create_thread_event_breakpoint): Likewise. Update callers to create_thread_event_breakpoint: * aix-thread.c (pd_enable): Update. * linux-thread-db.c (enable_thread_event): Update. * breakpoint.h (create_solib_event_breakpoint): Add GDBARCH. * breakpoint.c (create_solib_event_breakpoint): Likewise. Update callers to create_solib_event_breakpoint: * solib-frv.c (enable_break, enable_break2): Update. * solib-pa64.c (pa64_solib_create_inferior_hook): Update. * solib-som.c (som_solib_create_inferior_hook): Update. * solib-darwin.c (darwin_solib_create_inferior_hook): Update. * solib-svr4.c (enable_break): Update. * breakpoint.h (insert_single_step_breakpoint): Add GDBARCH. * breakpoint.c (insert_single_step_breakpoint): Likewise. Update callers to insert_single_step_breakpoint: * alpha-tdep.c (alpha_software_single_step): Update. * arm-linux-tdep.c (arm_linux_software_single_step): Update. * arm-tdep.c (arm_software_single_step): Update. * cris-tdep.c (cris_software_single_step): Update. * rs6000-aix-tdep.c (rs6000_software_single_step): Update. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Update. * sparc-tdep.c (sparc_software_single_step): Update. * spu-tdep.c (spu_software_single_step): Update. * mips-tdep.c (deal_with_atomic_sequence): Add GDBARCH parameter. Pass it to insert_single_step_breakpoint. (mips_software_single_step): Pass architecture to deal_with_atomic_sequence and insert_single_step_breakpoint. * breakpoint.h (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. * breakpoint.c (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. Update callers to deprecated_insert_raw_breakpoint and deprecated_remove_raw_breakpoint: * breakpoint.c (single_step_gdbarch): New static variable. (insert_single_step_breakpoint): Pass GDBARCH parameter to deprecated_insert_raw_breakpoint. Store it in single_step_gdbarch. (remove_single_step_breakpoints): Pass architecture stored in single_step_gdbarch to deprecated_remove_raw_breakpoint. * rs6000-nat.c (exec_one_dummy_insn): Update. * solib-irix.c (enable_break, disable_break): Update. * procfs.c (procfs_mourn_inferior): Update. (remove_dbx_link_breakpoint): Update. * breakpoint.h (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. * breakpoint.c (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. Update callers to set_breakpoint, set_momentary_breakpoint and set_momentary_breakpoint_at_pc: * breakpoint.c (set_momentary_breakpoint_at_pc): Update. (until_break_command): Update. * infcall.c (call_function_by_hand): Update. * infcmd.c (finish_backward, finish_forward): Update. * infrun.c (insert_step_resume_breakpoint_at_sal): Add GDBARCH parameter. Pass it to set_momentary_breakpoint. (insert_longjmp_resume_breakpoint): Add GDBARCH parameter. Pass it to set_momentary_breakpoint_at_pc. (handle_inferior_event): Update. (insert_step_resume_breakpoint_at_frame): Update. (insert_step_resume_breakpoint_at_caller): Update.. * mi/mi-cmd-break.c: Include "arch-utils.h". (mi_cmd_break_insert): Update. * target.h (struct target_ops): Add GDBARCH parameter to to_insert_breakpoint, to_remove_breakpoint, to_insert_hw_breakpoint, and to_remove_hw_breakpoint members. (target_insert_breakpoint, target_remove_breakpoint, target_insert_hw_breakpoint, target_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (memory_remove_breakpoint, memory_insert_breakpoint): Add GDBARCH parameter. * target.c (debug_to_insert_breakpoint, debug_to_remove_breakpoint, debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (update_current_target): Update function signature. * breakpoint.c (insert_bp_location, remove_breakpoint, deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint): Pass architecture to target_ routines. Update all implementations of the target breakpoint routines to take GDBARCH parameter and use it instead of GDBARCH as appropriate: * corelow.c (ignore): Update. * exec.c (ignore): Update. * mem-break.c (memory_insert_breakpoint): Update. (memory_remove_breakpoint): Update. * monitor.c (monitor_insert_breakpoint): Update. (monitor_remove_breakpoint): Update. * record.c (record_insert_breakpoint): Update. (record_beneath_to_insert_breakpoint): Update. (record_remove_breakpoint): Update. (record_beneath_to_remove_breakpoint): Update. * remote.c (remote_insert_breakpoint): Update. (remote_remove_breakpoint): Update. (remote_insert_hw_breakpoint): Update. (remote_remove_hw_breakpoint): Update. * remote-m32r-sdi.c (m32r_insert_breakpoint): Update. (m32r_remove_breakpoint): Update. * remote-mips.c (mips_insert_breakpoint): Update. (mips_remove_breakpoint): Update. * i386-nat.c (i386_insert_hw_breakpoint): Update. (i386_remove_hw_breakpoint): Update. * nto-procfs.c (procfs_insert_breakpoint): Update. (procfs_remove_breakpoint): Update. (procfs_insert_hw_breakpoint): Update. (procfs_remove_hw_breakpoint): Update. doc/ChangeLog: * gdbint.texi (Examples of Use of @code{ui_out} functions): Update example code extrated from breakpoint.c.
2009-07-02 19:12:28 +02:00
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
/* Set breakpoint and continue. */
breakpoint =
* breakpoint.h (struct breakpoint): New member GDBARCH. * breakpoint.c: Include "arch-utils.h". (set_raw_breakpoint_without_location): Add GDBARCH parameter. Use it to set breakpoint architecture. (set_raw_breakpoint): Add GDBARCH parameter. (create_internal_breakpoint): Likewise. (create_catchpoint): Likewise. (create_fork_vfork_event_catchpoint): Likewise. (create_breakpoint): Likewise. (create_breakpoints): Likewise. (break_command_really): Likewise. (create_ada_exception_breakpoint): Likewise. Update local callers to pass architecture: (create_internal_breakpoint): Update. (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_thread_event_breakpoint): Update. (create_solib_event_breakpoint): Update. (create_catchpoint): Update. (create_fork_vfork_event_catchpoint): Update. (set_momentary_breakpoint): Update. (clone_momentary_breakpoint): Update. (create_breakpoint): Update. (create_breakpoints): Update. (break_command_really): Update. (break_command_1): Update. (set_breakpoint): Update. (watch_command_1): Update. (catch_fork_command_1): Update. (catch_exec_commnd_1): Update. (handle_gnu_v3_exceptions): Update. (create_ada_exception_breakpoint): Update. (catch_ada_exception_command): Update. (catch_assert_command): Update. (trace_command): Update. * breakpoint.h (struct bp_location): New member GDBARCH. * breakpoint.c (get_sal_arch): New function. (set_raw_breakpoint): Set location architecture. (add_location_to_breakpoint): Likewise. (clone_momentary_breakpoint): Likewise. (watch_command_1): Likewise. (update_watchpoint): Likewise. (bp_loc_is_permanent): Use location architecture instead of current_gdbarch. (adjust_breakpoint_address): Add GDBARCH parameter; use it instead of current_gdbarch. Update callers of adjust_breakpoint_address to pass breakpoint location architecture: (set_raw_breakpoint): Update. (watch_command_1): Update. * tracepoint.c: (collect_symbol): Add GDBARCH parameter, use instead of current_gdbarch. (add_local_symbols): Add GDBARCH parameter. Pass to collect_symbol. (encode_actions): Pass tracepoint architecture to add_local_symbols (encode_actions): Use tracepoint architecture instead of current_gdbarch. Pass it to add_local_symbols and collect_symbol. * breakpoint.h (struct breakpoint_ops): Replace last_addr parameter of print_one callback with last_loc. * breakpoint.c (print_one_breakpoint_location): Replace last_addr parameter with last_loc. (print_one_breakpoint): Likewise. (do_captured_breakpoint_query): Update call. (breakpoint_1): Pass last_loc instead of last_addr to print_one_breakpoint. Pass last location architecture instead of current_gdbarch to set_next_address. Update all implementations of the print_one callback: * breakpoint.c (print_one_catch_fork): Update. (print_one_catch_vfork): Update. (print_one_catch_exec): Update. (print_one_exception_catchpoint): Update. * ada-lang.c (print_one_exception): Update. (print_one_catch_exception): Update. (print_one_catch_exception_unhandled): Update. (print_one_catch_assert): Update. * breakpoint.c (print_one_breakpoint_location): Add PRINT_ADDRESS_BITS parameter. Use it instead of gdbarch_addr_bit (current_gdbarch). (print_one_breakpoint): Add PRINT_ADDRESS_BITS parameter and pass it to print_one_breakpoint_location. (breakpoint_address_bits): New function. (do_captured_breakpoint_query): Compute number of address bits to print and pass it to print_one_breakpoint. (breakpoint_1): Likewise. Use it instead of current_gdbarch. * breakpoint.h (create_thread_event_breakpoint): Add GDBARCH. * breakpoint.c (create_thread_event_breakpoint): Likewise. Update callers to create_thread_event_breakpoint: * aix-thread.c (pd_enable): Update. * linux-thread-db.c (enable_thread_event): Update. * breakpoint.h (create_solib_event_breakpoint): Add GDBARCH. * breakpoint.c (create_solib_event_breakpoint): Likewise. Update callers to create_solib_event_breakpoint: * solib-frv.c (enable_break, enable_break2): Update. * solib-pa64.c (pa64_solib_create_inferior_hook): Update. * solib-som.c (som_solib_create_inferior_hook): Update. * solib-darwin.c (darwin_solib_create_inferior_hook): Update. * solib-svr4.c (enable_break): Update. * breakpoint.h (insert_single_step_breakpoint): Add GDBARCH. * breakpoint.c (insert_single_step_breakpoint): Likewise. Update callers to insert_single_step_breakpoint: * alpha-tdep.c (alpha_software_single_step): Update. * arm-linux-tdep.c (arm_linux_software_single_step): Update. * arm-tdep.c (arm_software_single_step): Update. * cris-tdep.c (cris_software_single_step): Update. * rs6000-aix-tdep.c (rs6000_software_single_step): Update. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Update. * sparc-tdep.c (sparc_software_single_step): Update. * spu-tdep.c (spu_software_single_step): Update. * mips-tdep.c (deal_with_atomic_sequence): Add GDBARCH parameter. Pass it to insert_single_step_breakpoint. (mips_software_single_step): Pass architecture to deal_with_atomic_sequence and insert_single_step_breakpoint. * breakpoint.h (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. * breakpoint.c (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. Update callers to deprecated_insert_raw_breakpoint and deprecated_remove_raw_breakpoint: * breakpoint.c (single_step_gdbarch): New static variable. (insert_single_step_breakpoint): Pass GDBARCH parameter to deprecated_insert_raw_breakpoint. Store it in single_step_gdbarch. (remove_single_step_breakpoints): Pass architecture stored in single_step_gdbarch to deprecated_remove_raw_breakpoint. * rs6000-nat.c (exec_one_dummy_insn): Update. * solib-irix.c (enable_break, disable_break): Update. * procfs.c (procfs_mourn_inferior): Update. (remove_dbx_link_breakpoint): Update. * breakpoint.h (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. * breakpoint.c (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. Update callers to set_breakpoint, set_momentary_breakpoint and set_momentary_breakpoint_at_pc: * breakpoint.c (set_momentary_breakpoint_at_pc): Update. (until_break_command): Update. * infcall.c (call_function_by_hand): Update. * infcmd.c (finish_backward, finish_forward): Update. * infrun.c (insert_step_resume_breakpoint_at_sal): Add GDBARCH parameter. Pass it to set_momentary_breakpoint. (insert_longjmp_resume_breakpoint): Add GDBARCH parameter. Pass it to set_momentary_breakpoint_at_pc. (handle_inferior_event): Update. (insert_step_resume_breakpoint_at_frame): Update. (insert_step_resume_breakpoint_at_caller): Update.. * mi/mi-cmd-break.c: Include "arch-utils.h". (mi_cmd_break_insert): Update. * target.h (struct target_ops): Add GDBARCH parameter to to_insert_breakpoint, to_remove_breakpoint, to_insert_hw_breakpoint, and to_remove_hw_breakpoint members. (target_insert_breakpoint, target_remove_breakpoint, target_insert_hw_breakpoint, target_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (memory_remove_breakpoint, memory_insert_breakpoint): Add GDBARCH parameter. * target.c (debug_to_insert_breakpoint, debug_to_remove_breakpoint, debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (update_current_target): Update function signature. * breakpoint.c (insert_bp_location, remove_breakpoint, deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint): Pass architecture to target_ routines. Update all implementations of the target breakpoint routines to take GDBARCH parameter and use it instead of GDBARCH as appropriate: * corelow.c (ignore): Update. * exec.c (ignore): Update. * mem-break.c (memory_insert_breakpoint): Update. (memory_remove_breakpoint): Update. * monitor.c (monitor_insert_breakpoint): Update. (monitor_remove_breakpoint): Update. * record.c (record_insert_breakpoint): Update. (record_beneath_to_insert_breakpoint): Update. (record_remove_breakpoint): Update. (record_beneath_to_remove_breakpoint): Update. * remote.c (remote_insert_breakpoint): Update. (remote_remove_breakpoint): Update. (remote_insert_hw_breakpoint): Update. (remote_remove_hw_breakpoint): Update. * remote-m32r-sdi.c (m32r_insert_breakpoint): Update. (m32r_remove_breakpoint): Update. * remote-mips.c (mips_insert_breakpoint): Update. (mips_remove_breakpoint): Update. * i386-nat.c (i386_insert_hw_breakpoint): Update. (i386_remove_hw_breakpoint): Update. * nto-procfs.c (procfs_insert_breakpoint): Update. (procfs_remove_breakpoint): Update. (procfs_insert_hw_breakpoint): Update. (procfs_remove_hw_breakpoint): Update. doc/ChangeLog: * gdbint.texi (Examples of Use of @code{ui_out} functions): Update example code extrated from breakpoint.c.
2009-07-02 19:12:28 +02:00
set_momentary_breakpoint (gdbarch, sal,
get_stack_frame_id (frame),
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
bp_breakpoint);
/* Tell the breakpoint to keep quiet. We won't be done
until we've done another reverse single-step. */
make_breakpoint_silent (breakpoint);
old_chain = make_cleanup_delete_breakpoint (breakpoint);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
/* We will be stopped when proceed returns. */
back_up = bpstat_find_breakpoint (tp->stop_bpstat, breakpoint) != NULL;
do_cleanups (old_chain);
}
else
back_up = 1;
if (back_up)
{
/* If in fact we hit the step-resume breakpoint (and not
some other breakpoint), then we're almost there --
we just need to back up by one more single-step. */
tp->step_range_start = tp->step_range_end = 1;
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
}
return;
}
/* finish_forward -- helper function for finish_command. */
static void
finish_forward (struct symbol *function, struct frame_info *frame)
{
* breakpoint.h (struct breakpoint): New member GDBARCH. * breakpoint.c: Include "arch-utils.h". (set_raw_breakpoint_without_location): Add GDBARCH parameter. Use it to set breakpoint architecture. (set_raw_breakpoint): Add GDBARCH parameter. (create_internal_breakpoint): Likewise. (create_catchpoint): Likewise. (create_fork_vfork_event_catchpoint): Likewise. (create_breakpoint): Likewise. (create_breakpoints): Likewise. (break_command_really): Likewise. (create_ada_exception_breakpoint): Likewise. Update local callers to pass architecture: (create_internal_breakpoint): Update. (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_thread_event_breakpoint): Update. (create_solib_event_breakpoint): Update. (create_catchpoint): Update. (create_fork_vfork_event_catchpoint): Update. (set_momentary_breakpoint): Update. (clone_momentary_breakpoint): Update. (create_breakpoint): Update. (create_breakpoints): Update. (break_command_really): Update. (break_command_1): Update. (set_breakpoint): Update. (watch_command_1): Update. (catch_fork_command_1): Update. (catch_exec_commnd_1): Update. (handle_gnu_v3_exceptions): Update. (create_ada_exception_breakpoint): Update. (catch_ada_exception_command): Update. (catch_assert_command): Update. (trace_command): Update. * breakpoint.h (struct bp_location): New member GDBARCH. * breakpoint.c (get_sal_arch): New function. (set_raw_breakpoint): Set location architecture. (add_location_to_breakpoint): Likewise. (clone_momentary_breakpoint): Likewise. (watch_command_1): Likewise. (update_watchpoint): Likewise. (bp_loc_is_permanent): Use location architecture instead of current_gdbarch. (adjust_breakpoint_address): Add GDBARCH parameter; use it instead of current_gdbarch. Update callers of adjust_breakpoint_address to pass breakpoint location architecture: (set_raw_breakpoint): Update. (watch_command_1): Update. * tracepoint.c: (collect_symbol): Add GDBARCH parameter, use instead of current_gdbarch. (add_local_symbols): Add GDBARCH parameter. Pass to collect_symbol. (encode_actions): Pass tracepoint architecture to add_local_symbols (encode_actions): Use tracepoint architecture instead of current_gdbarch. Pass it to add_local_symbols and collect_symbol. * breakpoint.h (struct breakpoint_ops): Replace last_addr parameter of print_one callback with last_loc. * breakpoint.c (print_one_breakpoint_location): Replace last_addr parameter with last_loc. (print_one_breakpoint): Likewise. (do_captured_breakpoint_query): Update call. (breakpoint_1): Pass last_loc instead of last_addr to print_one_breakpoint. Pass last location architecture instead of current_gdbarch to set_next_address. Update all implementations of the print_one callback: * breakpoint.c (print_one_catch_fork): Update. (print_one_catch_vfork): Update. (print_one_catch_exec): Update. (print_one_exception_catchpoint): Update. * ada-lang.c (print_one_exception): Update. (print_one_catch_exception): Update. (print_one_catch_exception_unhandled): Update. (print_one_catch_assert): Update. * breakpoint.c (print_one_breakpoint_location): Add PRINT_ADDRESS_BITS parameter. Use it instead of gdbarch_addr_bit (current_gdbarch). (print_one_breakpoint): Add PRINT_ADDRESS_BITS parameter and pass it to print_one_breakpoint_location. (breakpoint_address_bits): New function. (do_captured_breakpoint_query): Compute number of address bits to print and pass it to print_one_breakpoint. (breakpoint_1): Likewise. Use it instead of current_gdbarch. * breakpoint.h (create_thread_event_breakpoint): Add GDBARCH. * breakpoint.c (create_thread_event_breakpoint): Likewise. Update callers to create_thread_event_breakpoint: * aix-thread.c (pd_enable): Update. * linux-thread-db.c (enable_thread_event): Update. * breakpoint.h (create_solib_event_breakpoint): Add GDBARCH. * breakpoint.c (create_solib_event_breakpoint): Likewise. Update callers to create_solib_event_breakpoint: * solib-frv.c (enable_break, enable_break2): Update. * solib-pa64.c (pa64_solib_create_inferior_hook): Update. * solib-som.c (som_solib_create_inferior_hook): Update. * solib-darwin.c (darwin_solib_create_inferior_hook): Update. * solib-svr4.c (enable_break): Update. * breakpoint.h (insert_single_step_breakpoint): Add GDBARCH. * breakpoint.c (insert_single_step_breakpoint): Likewise. Update callers to insert_single_step_breakpoint: * alpha-tdep.c (alpha_software_single_step): Update. * arm-linux-tdep.c (arm_linux_software_single_step): Update. * arm-tdep.c (arm_software_single_step): Update. * cris-tdep.c (cris_software_single_step): Update. * rs6000-aix-tdep.c (rs6000_software_single_step): Update. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Update. * sparc-tdep.c (sparc_software_single_step): Update. * spu-tdep.c (spu_software_single_step): Update. * mips-tdep.c (deal_with_atomic_sequence): Add GDBARCH parameter. Pass it to insert_single_step_breakpoint. (mips_software_single_step): Pass architecture to deal_with_atomic_sequence and insert_single_step_breakpoint. * breakpoint.h (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. * breakpoint.c (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. Update callers to deprecated_insert_raw_breakpoint and deprecated_remove_raw_breakpoint: * breakpoint.c (single_step_gdbarch): New static variable. (insert_single_step_breakpoint): Pass GDBARCH parameter to deprecated_insert_raw_breakpoint. Store it in single_step_gdbarch. (remove_single_step_breakpoints): Pass architecture stored in single_step_gdbarch to deprecated_remove_raw_breakpoint. * rs6000-nat.c (exec_one_dummy_insn): Update. * solib-irix.c (enable_break, disable_break): Update. * procfs.c (procfs_mourn_inferior): Update. (remove_dbx_link_breakpoint): Update. * breakpoint.h (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. * breakpoint.c (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. Update callers to set_breakpoint, set_momentary_breakpoint and set_momentary_breakpoint_at_pc: * breakpoint.c (set_momentary_breakpoint_at_pc): Update. (until_break_command): Update. * infcall.c (call_function_by_hand): Update. * infcmd.c (finish_backward, finish_forward): Update. * infrun.c (insert_step_resume_breakpoint_at_sal): Add GDBARCH parameter. Pass it to set_momentary_breakpoint. (insert_longjmp_resume_breakpoint): Add GDBARCH parameter. Pass it to set_momentary_breakpoint_at_pc. (handle_inferior_event): Update. (insert_step_resume_breakpoint_at_frame): Update. (insert_step_resume_breakpoint_at_caller): Update.. * mi/mi-cmd-break.c: Include "arch-utils.h". (mi_cmd_break_insert): Update. * target.h (struct target_ops): Add GDBARCH parameter to to_insert_breakpoint, to_remove_breakpoint, to_insert_hw_breakpoint, and to_remove_hw_breakpoint members. (target_insert_breakpoint, target_remove_breakpoint, target_insert_hw_breakpoint, target_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (memory_remove_breakpoint, memory_insert_breakpoint): Add GDBARCH parameter. * target.c (debug_to_insert_breakpoint, debug_to_remove_breakpoint, debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (update_current_target): Update function signature. * breakpoint.c (insert_bp_location, remove_breakpoint, deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint): Pass architecture to target_ routines. Update all implementations of the target breakpoint routines to take GDBARCH parameter and use it instead of GDBARCH as appropriate: * corelow.c (ignore): Update. * exec.c (ignore): Update. * mem-break.c (memory_insert_breakpoint): Update. (memory_remove_breakpoint): Update. * monitor.c (monitor_insert_breakpoint): Update. (monitor_remove_breakpoint): Update. * record.c (record_insert_breakpoint): Update. (record_beneath_to_insert_breakpoint): Update. (record_remove_breakpoint): Update. (record_beneath_to_remove_breakpoint): Update. * remote.c (remote_insert_breakpoint): Update. (remote_remove_breakpoint): Update. (remote_insert_hw_breakpoint): Update. (remote_remove_hw_breakpoint): Update. * remote-m32r-sdi.c (m32r_insert_breakpoint): Update. (m32r_remove_breakpoint): Update. * remote-mips.c (mips_insert_breakpoint): Update. (mips_remove_breakpoint): Update. * i386-nat.c (i386_insert_hw_breakpoint): Update. (i386_remove_hw_breakpoint): Update. * nto-procfs.c (procfs_insert_breakpoint): Update. (procfs_remove_breakpoint): Update. (procfs_insert_hw_breakpoint): Update. (procfs_remove_hw_breakpoint): Update. doc/ChangeLog: * gdbint.texi (Examples of Use of @code{ui_out} functions): Update example code extrated from breakpoint.c.
2009-07-02 19:12:28 +02:00
struct gdbarch *gdbarch = get_frame_arch (frame);
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
struct symtab_and_line sal;
struct thread_info *tp = inferior_thread ();
struct breakpoint *breakpoint;
struct cleanup *old_chain;
struct finish_command_continuation_args *cargs;
sal = find_pc_line (get_frame_pc (frame), 0);
sal.pc = get_frame_pc (frame);
* breakpoint.h (struct breakpoint): New member GDBARCH. * breakpoint.c: Include "arch-utils.h". (set_raw_breakpoint_without_location): Add GDBARCH parameter. Use it to set breakpoint architecture. (set_raw_breakpoint): Add GDBARCH parameter. (create_internal_breakpoint): Likewise. (create_catchpoint): Likewise. (create_fork_vfork_event_catchpoint): Likewise. (create_breakpoint): Likewise. (create_breakpoints): Likewise. (break_command_really): Likewise. (create_ada_exception_breakpoint): Likewise. Update local callers to pass architecture: (create_internal_breakpoint): Update. (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_thread_event_breakpoint): Update. (create_solib_event_breakpoint): Update. (create_catchpoint): Update. (create_fork_vfork_event_catchpoint): Update. (set_momentary_breakpoint): Update. (clone_momentary_breakpoint): Update. (create_breakpoint): Update. (create_breakpoints): Update. (break_command_really): Update. (break_command_1): Update. (set_breakpoint): Update. (watch_command_1): Update. (catch_fork_command_1): Update. (catch_exec_commnd_1): Update. (handle_gnu_v3_exceptions): Update. (create_ada_exception_breakpoint): Update. (catch_ada_exception_command): Update. (catch_assert_command): Update. (trace_command): Update. * breakpoint.h (struct bp_location): New member GDBARCH. * breakpoint.c (get_sal_arch): New function. (set_raw_breakpoint): Set location architecture. (add_location_to_breakpoint): Likewise. (clone_momentary_breakpoint): Likewise. (watch_command_1): Likewise. (update_watchpoint): Likewise. (bp_loc_is_permanent): Use location architecture instead of current_gdbarch. (adjust_breakpoint_address): Add GDBARCH parameter; use it instead of current_gdbarch. Update callers of adjust_breakpoint_address to pass breakpoint location architecture: (set_raw_breakpoint): Update. (watch_command_1): Update. * tracepoint.c: (collect_symbol): Add GDBARCH parameter, use instead of current_gdbarch. (add_local_symbols): Add GDBARCH parameter. Pass to collect_symbol. (encode_actions): Pass tracepoint architecture to add_local_symbols (encode_actions): Use tracepoint architecture instead of current_gdbarch. Pass it to add_local_symbols and collect_symbol. * breakpoint.h (struct breakpoint_ops): Replace last_addr parameter of print_one callback with last_loc. * breakpoint.c (print_one_breakpoint_location): Replace last_addr parameter with last_loc. (print_one_breakpoint): Likewise. (do_captured_breakpoint_query): Update call. (breakpoint_1): Pass last_loc instead of last_addr to print_one_breakpoint. Pass last location architecture instead of current_gdbarch to set_next_address. Update all implementations of the print_one callback: * breakpoint.c (print_one_catch_fork): Update. (print_one_catch_vfork): Update. (print_one_catch_exec): Update. (print_one_exception_catchpoint): Update. * ada-lang.c (print_one_exception): Update. (print_one_catch_exception): Update. (print_one_catch_exception_unhandled): Update. (print_one_catch_assert): Update. * breakpoint.c (print_one_breakpoint_location): Add PRINT_ADDRESS_BITS parameter. Use it instead of gdbarch_addr_bit (current_gdbarch). (print_one_breakpoint): Add PRINT_ADDRESS_BITS parameter and pass it to print_one_breakpoint_location. (breakpoint_address_bits): New function. (do_captured_breakpoint_query): Compute number of address bits to print and pass it to print_one_breakpoint. (breakpoint_1): Likewise. Use it instead of current_gdbarch. * breakpoint.h (create_thread_event_breakpoint): Add GDBARCH. * breakpoint.c (create_thread_event_breakpoint): Likewise. Update callers to create_thread_event_breakpoint: * aix-thread.c (pd_enable): Update. * linux-thread-db.c (enable_thread_event): Update. * breakpoint.h (create_solib_event_breakpoint): Add GDBARCH. * breakpoint.c (create_solib_event_breakpoint): Likewise. Update callers to create_solib_event_breakpoint: * solib-frv.c (enable_break, enable_break2): Update. * solib-pa64.c (pa64_solib_create_inferior_hook): Update. * solib-som.c (som_solib_create_inferior_hook): Update. * solib-darwin.c (darwin_solib_create_inferior_hook): Update. * solib-svr4.c (enable_break): Update. * breakpoint.h (insert_single_step_breakpoint): Add GDBARCH. * breakpoint.c (insert_single_step_breakpoint): Likewise. Update callers to insert_single_step_breakpoint: * alpha-tdep.c (alpha_software_single_step): Update. * arm-linux-tdep.c (arm_linux_software_single_step): Update. * arm-tdep.c (arm_software_single_step): Update. * cris-tdep.c (cris_software_single_step): Update. * rs6000-aix-tdep.c (rs6000_software_single_step): Update. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Update. * sparc-tdep.c (sparc_software_single_step): Update. * spu-tdep.c (spu_software_single_step): Update. * mips-tdep.c (deal_with_atomic_sequence): Add GDBARCH parameter. Pass it to insert_single_step_breakpoint. (mips_software_single_step): Pass architecture to deal_with_atomic_sequence and insert_single_step_breakpoint. * breakpoint.h (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. * breakpoint.c (deprecated_insert_raw_breakpoint): Add GDBARCH. (deprecated_remove_raw_breakpoint): Likewise. Update callers to deprecated_insert_raw_breakpoint and deprecated_remove_raw_breakpoint: * breakpoint.c (single_step_gdbarch): New static variable. (insert_single_step_breakpoint): Pass GDBARCH parameter to deprecated_insert_raw_breakpoint. Store it in single_step_gdbarch. (remove_single_step_breakpoints): Pass architecture stored in single_step_gdbarch to deprecated_remove_raw_breakpoint. * rs6000-nat.c (exec_one_dummy_insn): Update. * solib-irix.c (enable_break, disable_break): Update. * procfs.c (procfs_mourn_inferior): Update. (remove_dbx_link_breakpoint): Update. * breakpoint.h (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. * breakpoint.c (set_breakpoint): Add GDBARCH parameter. (set_momentary_breakpoint, set_momentary_breakpoint_at_pc): Likewise. Update callers to set_breakpoint, set_momentary_breakpoint and set_momentary_breakpoint_at_pc: * breakpoint.c (set_momentary_breakpoint_at_pc): Update. (until_break_command): Update. * infcall.c (call_function_by_hand): Update. * infcmd.c (finish_backward, finish_forward): Update. * infrun.c (insert_step_resume_breakpoint_at_sal): Add GDBARCH parameter. Pass it to set_momentary_breakpoint. (insert_longjmp_resume_breakpoint): Add GDBARCH parameter. Pass it to set_momentary_breakpoint_at_pc. (handle_inferior_event): Update. (insert_step_resume_breakpoint_at_frame): Update. (insert_step_resume_breakpoint_at_caller): Update.. * mi/mi-cmd-break.c: Include "arch-utils.h". (mi_cmd_break_insert): Update. * target.h (struct target_ops): Add GDBARCH parameter to to_insert_breakpoint, to_remove_breakpoint, to_insert_hw_breakpoint, and to_remove_hw_breakpoint members. (target_insert_breakpoint, target_remove_breakpoint, target_insert_hw_breakpoint, target_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (memory_remove_breakpoint, memory_insert_breakpoint): Add GDBARCH parameter. * target.c (debug_to_insert_breakpoint, debug_to_remove_breakpoint, debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint): Add GDBARCH parameter, pass to target routine. (update_current_target): Update function signature. * breakpoint.c (insert_bp_location, remove_breakpoint, deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint): Pass architecture to target_ routines. Update all implementations of the target breakpoint routines to take GDBARCH parameter and use it instead of GDBARCH as appropriate: * corelow.c (ignore): Update. * exec.c (ignore): Update. * mem-break.c (memory_insert_breakpoint): Update. (memory_remove_breakpoint): Update. * monitor.c (monitor_insert_breakpoint): Update. (monitor_remove_breakpoint): Update. * record.c (record_insert_breakpoint): Update. (record_beneath_to_insert_breakpoint): Update. (record_remove_breakpoint): Update. (record_beneath_to_remove_breakpoint): Update. * remote.c (remote_insert_breakpoint): Update. (remote_remove_breakpoint): Update. (remote_insert_hw_breakpoint): Update. (remote_remove_hw_breakpoint): Update. * remote-m32r-sdi.c (m32r_insert_breakpoint): Update. (m32r_remove_breakpoint): Update. * remote-mips.c (mips_insert_breakpoint): Update. (mips_remove_breakpoint): Update. * i386-nat.c (i386_insert_hw_breakpoint): Update. (i386_remove_hw_breakpoint): Update. * nto-procfs.c (procfs_insert_breakpoint): Update. (procfs_remove_breakpoint): Update. (procfs_insert_hw_breakpoint): Update. (procfs_remove_hw_breakpoint): Update. doc/ChangeLog: * gdbint.texi (Examples of Use of @code{ui_out} functions): Update example code extrated from breakpoint.c.
2009-07-02 19:12:28 +02:00
breakpoint = set_momentary_breakpoint (gdbarch, sal,
get_stack_frame_id (frame),
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
bp_finish);
old_chain = make_cleanup_delete_breakpoint (breakpoint);
tp->proceed_to_finish = 1; /* We want stop_registers, please... */
cargs = xmalloc (sizeof (*cargs));
cargs->breakpoint = breakpoint;
cargs->function = function;
add_continuation (tp, finish_command_continuation, cargs,
finish_command_continuation_free_arg);
2009-10-19 Pedro Alves <pedro@codesourcery.com> 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".
2009-10-19 11:51:43 +02:00
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
discard_cleanups (old_chain);
if (!target_can_async_p ())
do_all_continuations ();
}
/* "finish": Set a temporary breakpoint at the place the selected
frame will return to, then continue. */
static void
2000-07-30 03:48:28 +02:00
finish_command (char *arg, int from_tty)
{
struct frame_info *frame;
struct symbol *function;
1999-07-05 19:58:44 +02:00
int async_exec = 0;
ERROR_NO_INFERIOR;
ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
/* Find out whether we must run in the background. */
1999-07-05 19:58:44 +02:00
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
error out. */
if (async_exec && !target_can_async_p ())
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Asynchronous execution not supported on this target."));
1999-07-05 19:58:44 +02:00
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
/* Don't try to async in reverse. */
if (async_exec && execution_direction == EXEC_REVERSE)
error (_("Asynchronous 'finish' not supported in reverse."));
1999-07-05 19:58:44 +02:00
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
1999-07-07 22:19:36 +02:00
{
/* Simulate synchronous execution. */
1999-09-28 23:55:21 +02:00
async_disable_stdin ();
1999-07-05 19:58:44 +02:00
}
if (arg)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("The \"finish\" command does not take any arguments."));
frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
if (frame == 0)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("\"finish\" not meaningful in the outermost frame."));
clear_proceed_status ();
gdb/ * NEWS: Document inlined function support. * Makefile.in (SFILES): Add inline-frame.c. (COMMON_OBS): Add inline-frame.o. * block.c (contained_in): Rewrite to use lexical nesting. (block_linkage_function): Skip inlined function blocks. (block_inlined_p): New. * block.h (struct block): Update comment. (block_inlined_p): New prototype. * blockframe.c (get_frame_block): Handle inlined functions. (get_frame_function): Do not use block_linkage_function. (block_innermost_frame): Use get_frame_block and contained_in. * breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache. Skip over inlined functions. Simplify epilogue check. (bpstat_check_breakpoint_conditions): Use get_stack_frame_id. Update comments. (set_momentary_breakpoint): Only accept non-inlined frames. (watch_command_1): Use frame_unwind_caller_pc and frame_unwind_caller_id instead of get_prev_frame. (until_break_command): Likewise. Use get_stack_frame_id. * buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions. * dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function. * dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine. (read_func_scope, new_symbol): Likewise. Handle arguments specially for inlined functions without call site information. (inherit_abstract_dies): Allow tag mismatch for inlined subroutines. (die_specification): Treat DW_AT_abstract_origin as a specification. (read_type_die): Handle DW_TAG_inlined_subroutine. * frame-unwind.c (frame_unwind_init): Add inline_frame_unwind. * frame.c (fprint_frame_id): Print inline depth. (fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME. (skip_inlined_frames, get_stack_frame_id): New. (frame_unwind_caller_id): Use skip_inlined_frames. (frame_id_inlined_p): New. (frame_id_eq): Make the logic match the comments. Add inline_depth check. (frame_id_inner): Handle inlined functions. (frame_unwind_pc): New function, copied from frame_unwind_caller_pc. (frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc. (get_prev_frame_1): Check for inline frames. Split out frame allocation to get_prev_frame_raw. (get_prev_frame_raw): New function. (get_prev_frame): Handle inline frames. (get_frame_pc): Use frame_unwind_pc. (get_frame_address_in_block): Skip inlined frames on both sides. (pc_notcurrent): Delete. (find_frame_sal): Rewrite to handle inline call sites. Use get_frame_address_in_block. (deprecated_update_frame_pc_hack): Make static. * frame.h: Update comments. (struct frame_id): Add inline_depth. (enum frame_type): Add INLINE_FRAME. (frame_id_inlined_p, get_stack_frame_id): New prototypes. * gdbthread.h (struct thread_info): Add step_stack_frame_id field. * infcmd.c (set_step_frame): New function. (step_once): Use set_step_frame. Handle inlined functions. (until_next_command): Use set_step_frame. (finish_backward), finish_forward): Use get_stack_frame_id. (finish_command): Support inlined functions. * inferior.h (set_step_info): New prototype. * infrun.c (RESUME_ALL): Use minus_one_ptid. (clear_proceed_status): Clear step_stack_frame_id. (init_wait_for_inferior): Call clear_inline_frame_state. (init_execution_control_state): Make static. (set_step_info): New function. (init_thread_stepping_state): Do not set the symtab or line here. (stepped_in_from): New function. (handle_inferior_event): Handle inlined functions. Use set_step_info. (insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id. (struct inferior_status): Add step_stack_frame_id. (save_inferior_status, restore_inferior_status): Save and restore step_stack_frame_id. * inline-frame.c, inline-frame.h: New files. * minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC. * regcache.c (regcache_write_pc): Call reinit_frame_cache. * s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME. * stack.c (frame_show_address): New. (print_frame_info, print_frame): Use it. (find_frame_funname): Use get_frame_function. Handle inlined blocks. (frame_info): Mark inlined functions. (backtrace_command_1): Use get_current_user_frame. (print_frame_local_vars, print_frame_label_vars): Update comments. (return_command): Refuse inlined functions. * symtab.c (lookup_symbol_aux_local): Stop at inlined function boundaries. (find_function_start_sal): Avoid inlined functions. (completion_list_add_fields): New function. (default_make_symbol_completion_list): Use it. Use block_static_block and block_global_block. Check for inlined functions. (skip_prologue_using_sal): Avoid line number comparison across inlining. * symtab.h (struct symbol): Add is_inlined. (SYMBOL_INLINED): New. * target.c (target_resume): Call clear_inline_frame_state. * valops.c (value_of_variable): Check block_inlined_p. gdb/doc/ * gdb.texinfo (Debugging Optimized Code): New chapter. (Compiling for Debugging): Reference it. Move some text to the new section. gdb/testsuite/ * gdb.base/break.exp: Add an XFAIL for gcc/36748. * gdb.cp/annota2.exp: Accept frames-invalid in more places. * gdb.opt/Makefile.in (EXECUTABLES): Update. * gdb.opt/clobbered-registers-O2.exp: Update to GPL v3. * gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp, gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp, gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp, gdb.opt/inline-markers.c: New files. * lib/gdb.exp (skip_inline_frame_tests): New function. (skip_inline_var_tests): New function.
2009-06-28 02:20:24 +02:00
/* Finishing from an inline frame is completely different. We don't
try to show the "return value" - no way to locate it. So we do
not need a completion. */
if (get_frame_type (get_selected_frame (_("No selected frame.")))
== INLINE_FRAME)
{
/* Claim we are stepping in the calling frame. An empty step
range means that we will stop once we aren't in a function
called by that frame. We don't use the magic "1" value for
step_range_end, because then infrun will think this is nexti,
and not step over the rest of this inlined function call. */
struct thread_info *tp = inferior_thread ();
struct symtab_and_line empty_sal;
init_sal (&empty_sal);
set_step_info (frame, empty_sal);
tp->step_range_start = tp->step_range_end = get_frame_pc (frame);
tp->step_over_calls = STEP_OVER_ALL;
/* Print info on the selected frame, including level number but not
source. */
if (from_tty)
{
printf_filtered (_("Run till exit from "));
print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
}
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
return;
}
/* Find the function we will return from. */
function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
/* Print info on the selected frame, including level number but not
source. */
if (from_tty)
{
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
if (execution_direction == EXEC_REVERSE)
printf_filtered (_("Run back to call of "));
else
printf_filtered (_("Run till exit from "));
print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
}
2008-10-17 Michael Snyder <msnyder@vmware.com> Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (struct target_ops): New method to_can_execute_reverse. (target_can_execute_reverse): New macro. * target.c (update_current_target): Inherit to_can_execute_reverse. Remote interface for reverse debugging. * remote.c (remote_can_execute_reverse): New target method. (remote_resume): Check for reverse exec direction, and send appropriate command to target. (remote_wait_as): Check target response for NO_HISTORY status. Also check for empty reply (target doesn't understand "bs" or "bc). (remote_vcont_resume): Jump out if attempting reverse execution. Event handling interface for reverse debugging. * infrun.c (execution_direction): New state variable. (enum inferior_stop_reason): Add NO_HISTORY reason. (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY. Handle stepping over a function call in reverse. Handle stepping thru a line range in reverse. Handle setting a step-resume breakpoint in reverse. Handle stepping into a function in reverse. Handle stepping between line ranges in reverse. (print_stop_reason): Print reason for NO_HISTORY. (step_into_function): Rename to handle_step_into_function. (handle_step_into_function_backward): New function. (set_exec_direction_func, show_exec_direction_func): New funcs. (proceed): No need to singlestep over a breakpoint when resuming in reverse. * inferior.h (enum exec_direction_kind): New enum. (execution_direction): Export new execution state variable. * breakpoint.c (make_breakpoint_silent): New function. * breakpoint.h (make_breakpoint_silent): Export. * infcmd.c (finish_command): Check for reverse exec direction. (finish_backward): New function, handle finish cmd in reverse. User interface for reverse execution. * Makefile.in (reverse.c): New file. * reverse.c: New file. User interface for reverse execution.
2008-10-17 21:43:47 +02:00
if (execution_direction == EXEC_REVERSE)
finish_backward (function);
else
finish_forward (function, frame);
}
static void
2000-07-30 03:48:28 +02:00
program_info (char *args, int from_tty)
{
bpstat bs;
int num, stat;
struct thread_info *tp;
ptid_t ptid;
1999-07-07 22:19:36 +02:00
if (!target_has_execution)
{
printf_filtered (_("The program being debugged is not being run.\n"));
return;
}
if (non_stop)
ptid = inferior_ptid;
else
{
struct target_waitstatus ws;
get_last_target_status (&ptid, &ws);
}
if (ptid_equal (ptid, null_ptid) || is_exited (ptid))
error (_("Invalid selected thread."));
else if (is_running (ptid))
error (_("Selected thread is running."));
tp = find_thread_ptid (ptid);
bs = tp->stop_bpstat;
stat = bpstat_num (&bs, &num);
target_files_info ();
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
printf_filtered (_("Program stopped at %s.\n"),
paddress (target_gdbarch, stop_pc));
if (tp->stop_step)
printf_filtered (_("It stopped after being stepped.\n"));
else if (stat != 0)
{
/* There may be several breakpoints in the same place, so this
1999-07-07 22:19:36 +02:00
isn't as strange as it seems. */
while (stat != 0)
{
if (stat < 0)
{
printf_filtered (_("\
It stopped at a breakpoint that has since been deleted.\n"));
}
else
printf_filtered (_("It stopped at breakpoint %d.\n"), num);
stat = bpstat_num (&bs, &num);
}
}
Remove the global stop_signal in favour of a per-thread stop_signal. * inferior.h (stop_signal): Delete. * gdbthread.h (save_infrun_state, load_infrun_state): Remove stop_signal argument. * thread.c (load_infrun_state, save_infrun_state): Remove stop_signal argument. Don't reference it. * infcmd.c (stop_signal): Delete. (program_info): Adjust. * infrun.c (resume): Clear stop_signal. (proceed): Adjust. Pass the last stop_signal to the thread we're resuming. (context_switch): Don't context-switch stop_signal. (handle_inferior_event, keep_going): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * fbsd-nat.c: Include "gdbthread.h". (find_signalled_thread, find_stop_signal): New. (fbsd_make_corefile_notes): Use it. * fork-child.c (startup_inferior): Adjust. * linux-nat.c (get_pending_status): Adjust. (linux_nat_do_thread_registers): Adjust. (find_signalled_thread, find_stop_signal): New. (linux_nat_do_thread_registers): Add stop_signal parameter. (struct linux_nat_corefile_thread_data): Add stop_signal member. (linux_nat_corefile_thread_callback): Pass stop_signal. (linux_nat_do_registers): Delete. (linux_nat_make_corefile_notes): Use find_stop_signal. Assume there's always a thread. * procfs.c (find_signalled_thread, find_stop_signal): New. (find_stop_signal): New. (procfs_do_thread_registers): Add stop_signal parameter. (struct procfs_corefile_thread_data): Add stop_signal member. (procfs_corefile_thread_callback): Pass args->stop_signal. (procfs_make_note_section): Find the last stop_signal. * solib-irix.c: Include gdbthread.h. (irix_solib_create_inferior_hook): Adjust. * solib-osf.c: Include gdbthread.h. (osf_solib_create_inferior_hook): Adjust. * solib-sunos.c: Include gdbthread.h. (sunos_solib_create_inferior_hook): Adjust. * solib-svr4.c: Include gdbthread.h. (svr4_solib_create_inferior_hook): Adjust. * win32-nat.c (do_initial_win32_stuff): Adjust.
2008-09-08 23:51:18 +02:00
else if (tp->stop_signal != TARGET_SIGNAL_0)
{
printf_filtered (_("It stopped with signal %s, %s.\n"),
Remove the global stop_signal in favour of a per-thread stop_signal. * inferior.h (stop_signal): Delete. * gdbthread.h (save_infrun_state, load_infrun_state): Remove stop_signal argument. * thread.c (load_infrun_state, save_infrun_state): Remove stop_signal argument. Don't reference it. * infcmd.c (stop_signal): Delete. (program_info): Adjust. * infrun.c (resume): Clear stop_signal. (proceed): Adjust. Pass the last stop_signal to the thread we're resuming. (context_switch): Don't context-switch stop_signal. (handle_inferior_event, keep_going): Adjust. (save_inferior_status, restore_inferior_status): Adjust. * fbsd-nat.c: Include "gdbthread.h". (find_signalled_thread, find_stop_signal): New. (fbsd_make_corefile_notes): Use it. * fork-child.c (startup_inferior): Adjust. * linux-nat.c (get_pending_status): Adjust. (linux_nat_do_thread_registers): Adjust. (find_signalled_thread, find_stop_signal): New. (linux_nat_do_thread_registers): Add stop_signal parameter. (struct linux_nat_corefile_thread_data): Add stop_signal member. (linux_nat_corefile_thread_callback): Pass stop_signal. (linux_nat_do_registers): Delete. (linux_nat_make_corefile_notes): Use find_stop_signal. Assume there's always a thread. * procfs.c (find_signalled_thread, find_stop_signal): New. (find_stop_signal): New. (procfs_do_thread_registers): Add stop_signal parameter. (struct procfs_corefile_thread_data): Add stop_signal member. (procfs_corefile_thread_callback): Pass args->stop_signal. (procfs_make_note_section): Find the last stop_signal. * solib-irix.c: Include gdbthread.h. (irix_solib_create_inferior_hook): Adjust. * solib-osf.c: Include gdbthread.h. (osf_solib_create_inferior_hook): Adjust. * solib-sunos.c: Include gdbthread.h. (sunos_solib_create_inferior_hook): Adjust. * solib-svr4.c: Include gdbthread.h. (svr4_solib_create_inferior_hook): Adjust. * win32-nat.c (do_initial_win32_stuff): Adjust.
2008-09-08 23:51:18 +02:00
target_signal_to_name (tp->stop_signal),
target_signal_to_string (tp->stop_signal));
}
if (!from_tty)
{
printf_filtered (_("\
Type \"info stack\" or \"info registers\" for more information.\n"));
}
}
static void
2000-07-30 03:48:28 +02:00
environment_info (char *var, int from_tty)
{
if (var)
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
char *val = get_in_environ (current_inferior ()->environment, var);
if (val)
{
puts_filtered (var);
puts_filtered (" = ");
puts_filtered (val);
puts_filtered ("\n");
}
else
{
puts_filtered ("Environment variable \"");
puts_filtered (var);
puts_filtered ("\" not defined.\n");
}
}
else
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
char **vector = environ_vector (current_inferior ()->environment);
while (*vector)
{
puts_filtered (*vector++);
puts_filtered ("\n");
}
}
}
static void
2000-07-30 03:48:28 +02:00
set_environment_command (char *arg, int from_tty)
{
char *p, *val, *var;
int nullset = 0;
if (arg == 0)
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
error_no_arg (_("environment variable and value"));
/* Find seperation between variable name and value */
p = (char *) strchr (arg, '=');
val = (char *) strchr (arg, ' ');
if (p != 0 && val != 0)
{
/* We have both a space and an equals. If the space is before the
1999-07-07 22:19:36 +02:00
equals, walk forward over the spaces til we see a nonspace
(possibly the equals). */
if (p > val)
while (*val == ' ')
val++;
/* Now if the = is after the char following the spaces,
1999-07-07 22:19:36 +02:00
take the char following the spaces. */
if (p > val)
p = val - 1;
}
else if (val != 0 && p == 0)
p = val;
if (p == arg)
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
error_no_arg (_("environment variable to set"));
if (p == 0 || p[1] == 0)
{
nullset = 1;
if (p == 0)
p = arg + strlen (arg); /* So that savestring below will work */
}
else
{
/* Not setting variable value to null */
val = p + 1;
while (*val == ' ' || *val == '\t')
val++;
}
1999-07-07 22:19:36 +02:00
while (p != arg && (p[-1] == ' ' || p[-1] == '\t'))
p--;
var = savestring (arg, p - arg);
if (nullset)
{
printf_filtered (_("\
Setting environment variable \"%s\" to null value.\n"),
var);
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_in_environ (current_inferior ()->environment, var, "");
}
else
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_in_environ (current_inferior ()->environment, var, val);
2000-12-15 02:01:51 +01:00
xfree (var);
}
static void
2000-07-30 03:48:28 +02:00
unset_environment_command (char *var, int from_tty)
{
if (var == 0)
{
/* If there is no argument, delete all environment variables.
1999-07-07 22:19:36 +02:00
Ask for confirmation if reading from the terminal. */
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
if (!from_tty || query (_("Delete all environment variables? ")))
{
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
free_environ (current_inferior ()->environment);
current_inferior ()->environment = make_environ ();
}
}
else
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
unset_in_environ (current_inferior ()->environment, var);
}
/* Handle the execution path (PATH variable) */
static const char path_var_name[] = "PATH";
static void
2000-07-30 03:48:28 +02:00
path_info (char *args, int from_tty)
{
puts_filtered ("Executable and object file path: ");
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
puts_filtered (get_in_environ (current_inferior ()->environment, path_var_name));
puts_filtered ("\n");
}
/* Add zero or more directories to the front of the execution path. */
static void
2000-07-30 03:48:28 +02:00
path_command (char *dirname, int from_tty)
{
char *exec_path;
char *env;
dont_repeat ();
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
env = get_in_environ (current_inferior ()->environment, path_var_name);
/* Can be null if path is not set */
if (!env)
env = "";
2001-01-31 02:24:03 +01:00
exec_path = xstrdup (env);
mod_path (dirname, &exec_path);
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_in_environ (current_inferior ()->environment, path_var_name, exec_path);
2000-12-15 02:01:51 +01:00
xfree (exec_path);
if (from_tty)
1999-07-07 22:19:36 +02:00
path_info ((char *) NULL, from_tty);
}
1999-07-07 22:19:36 +02:00
/* Print out the machine register regnum. If regnum is -1, print all
registers (print_all == 1) or all non-float and non-vector
registers (print_all == 0).
For most machines, having all_registers_info() print the
register(s) one per line is good enough. If a different format is
required, (eg, for MIPS or Pyramid 90x, which both have lots of
regs), or there is an existing convention for showing all the
registers, define the architecture method PRINT_REGISTERS_INFO to
provide that format. */
void
default_print_registers_info (struct gdbarch *gdbarch,
struct ui_file *file,
struct frame_info *frame,
int regnum, int print_all)
{
int i;
const int numregs = gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch);
gdb_byte buffer[MAX_REGISTER_SIZE];
for (i = 0; i < numregs; i++)
{
/* Decide between printing all regs, non-float / vector regs, or
specific reg. */
1999-07-07 22:19:36 +02:00
if (regnum == -1)
{
if (print_all)
{
if (!gdbarch_register_reggroup_p (gdbarch, i, all_reggroup))
continue;
}
else
{
if (!gdbarch_register_reggroup_p (gdbarch, i, general_reggroup))
continue;
}
1999-07-07 22:19:36 +02:00
}
else
{
if (i != regnum)
continue;
}
/* If the register name is empty, it is undefined for this
1999-07-07 22:19:36 +02:00
processor, so don't display anything. */
if (gdbarch_register_name (gdbarch, i) == NULL
|| *(gdbarch_register_name (gdbarch, i)) == '\0')
continue;
fputs_filtered (gdbarch_register_name (gdbarch, i), file);
2007-06-09 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (REGISTER_NAME): Replace by gdbarch_register_name. * tracepoint.c (scope_info): Likewise. * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * sh-tdep.c (sh_register_reggroup_p): Likewise. * sh64-tdep.c (sh64_do_fp_register, sh64_do_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_reggroup_p): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. * remote.c (packet_reg): Likewise (comment). * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (regcache_dump): Likewise. * printcmd.c (address_info): Likewise. * ppc-linux-nat.c (fetch_register, store_register): Likewise. * mt-dep.c (mt_registers_info): Likewise. * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Likewise (comment). * mips-tdep.c (mips_register_reggroup_p, mips_read_fp_register_single) (mips_read_fp_register_double, mips_print_fp_register) (mips_print_register, print_gp_register_row, mips_print_registers_info) (mips_register_sim_regno): Likewise. * m68klinux-nat.c (regmap, fetch_register, store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register) (inf_ptrace_store_register): Likewise. * infcmd.c (default_print_registers_info): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register) (ia64_linux_store_register): Likewise. * i386-linux-nat.c (fetch_register, store_register): Likewise. * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register) (hppa_hpux_store_register): Likewise. * findvar.c (locate_var_value): Likewise. * dwarf2loc.c (locexpr_describe_location): Likewise. * dwarf2-frame.c (execute_cfa_program): Likewise. * arm-tdep.c (arm_push_dummy_call): Likewise. * arch-utils.c (legacy_register_sim_regno): Likewise. * alpha-tdep.c (alpha_register_reggroup_p): Likewise. * alpha-nat.c (fetch_osf_core_registers): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers, mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate.
2007-06-09 15:42:16 +02:00
print_spaces_filtered (15 - strlen (gdbarch_register_name
(gdbarch, i)), file);
/* Get the data in raw format. */
if (! frame_register_read (frame, i, buffer))
{
fprintf_filtered (file, "*value not available*\n");
continue;
}
/* If virtual format is floating, print it that way, and in raw
hex. */
if (TYPE_CODE (register_type (gdbarch, i)) == TYPE_CODE_FLT
|| TYPE_CODE (register_type (gdbarch, i)) == TYPE_CODE_DECFLOAT)
{
int j;
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
struct value_print_options opts;
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
get_user_print_options (&opts);
opts.deref_ref = 1;
val_print (register_type (gdbarch, i), buffer, 0, 0,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
file, 0, &opts, current_language);
fprintf_filtered (file, "\t(raw 0x");
for (j = 0; j < register_size (gdbarch, i); j++)
{
int idx;
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
idx = j;
else
idx = register_size (gdbarch, i) - 1 - j;
fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
}
fprintf_filtered (file, ")");
}
else
{
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
struct value_print_options opts;
/* Print the register in hex. */
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
get_formatted_print_options (&opts, 'x');
opts.deref_ref = 1;
val_print (register_type (gdbarch, i), buffer, 0, 0,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
file, 0, &opts,
current_language);
/* If not a vector register, print it also according to its
natural format. */
if (TYPE_VECTOR (register_type (gdbarch, i)) == 0)
{
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
get_user_print_options (&opts);
opts.deref_ref = 1;
fprintf_filtered (file, "\t");
val_print (register_type (gdbarch, i), buffer, 0, 0,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
file, 0, &opts, current_language);
}
}
fprintf_filtered (file, "\n");
}
}
void
2000-07-30 03:48:28 +02:00
registers_info (char *addr_exp, int fpregs)
{
struct frame_info *frame;
struct gdbarch *gdbarch;
if (!target_has_registers)
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("The program has no registers now."));
frame = get_selected_frame (NULL);
gdbarch = get_frame_arch (frame);
if (!addr_exp)
{
gdbarch_print_registers_info (gdbarch, gdb_stdout,
frame, -1, fpregs);
return;
}
while (*addr_exp != '\0')
1999-07-07 22:19:36 +02:00
{
char *start;
const char *end;
/* Keep skipping leading white space. */
if (isspace ((*addr_exp)))
{
addr_exp++;
continue;
}
/* Discard any leading ``$''. Check that there is something
resembling a register following it. */
if (addr_exp[0] == '$')
addr_exp++;
if (isspace ((*addr_exp)) || (*addr_exp) == '\0')
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Missing register name"));
/* Find the start/end of this register name/num/group. */
start = addr_exp;
while ((*addr_exp) != '\0' && !isspace ((*addr_exp)))
addr_exp++;
end = addr_exp;
/* Figure out what we've found and display it. */
/* A register name? */
{
int regnum = user_reg_map_name_to_regnum (gdbarch, start, end - start);
if (regnum >= 0)
{
/* User registers lie completely outside of the range of
normal registers. Catch them early so that the target
never sees them. */
if (regnum >= gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch))
{
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
struct value_print_options opts;
struct value *val = value_of_user_reg (regnum, frame);
printf_filtered ("%s: ", start);
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
get_formatted_print_options (&opts, 'x');
print_scalar_formatted (value_contents (val),
check_typedef (value_type (val)),
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
&opts, 0, gdb_stdout);
printf_filtered ("\n");
}
else
gdbarch_print_registers_info (gdbarch, gdb_stdout,
frame, regnum, fpregs);
continue;
}
}
/* A register group? */
{
struct reggroup *group;
for (group = reggroup_next (gdbarch, NULL);
group != NULL;
group = reggroup_next (gdbarch, group))
{
/* Don't bother with a length check. Should the user
enter a short register group name, go with the first
group that matches. */
if (strncmp (start, reggroup_name (group), end - start) == 0)
break;
}
if (group != NULL)
{
int regnum;
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
for (regnum = 0;
regnum < gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch);
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, group))
gdbarch_print_registers_info (gdbarch,
gdb_stdout, frame,
regnum, fpregs);
}
continue;
}
}
/* Nothing matched. */
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Invalid register `%.*s'"), (int) (end - start), start);
1999-07-07 22:19:36 +02:00
}
}
void
2000-07-30 03:48:28 +02:00
all_registers_info (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 1);
}
static void
2000-07-30 03:48:28 +02:00
nofp_registers_info (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 0);
}
static void
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
print_vector_info (struct ui_file *file,
struct frame_info *frame, const char *args)
{
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_print_vector_info_p (gdbarch))
gdbarch_print_vector_info (gdbarch, file, frame, args);
else
{
int regnum;
int printed_something = 0;
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
for (regnum = 0;
regnum < gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch);
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, vector_reggroup))
{
printed_something = 1;
gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
}
}
if (!printed_something)
fprintf_filtered (file, "No vector information\n");
}
}
static void
vector_info (char *args, int from_tty)
{
if (!target_has_registers)
error (_("The program has no registers now."));
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
print_vector_info (gdb_stdout, get_selected_frame (NULL), args);
}
/* Kill the inferior process. Make us have no inferior. */
static void
kill_command (char *arg, int from_tty)
{
/* FIXME: This should not really be inferior_ptid (or target_has_execution).
It should be a distinct flag that indicates that a target is active, cuz
some targets don't have processes! */
if (ptid_equal (inferior_ptid, null_ptid))
error (_("The program is not being run."));
if (!query (_("Kill the program being debugged? ")))
error (_("Not confirmed."));
target_kill ();
* target.h (struct target_ops): Make to_has_all_memory, to_has_memory, to_has_stack, to_has_registers and to_has_execution methods instead of variables. (target_has_all_memory_1, target_has_memory_1, target_has_stack_1) (target_has_registers_1, target_has_execution_1): Declare functions. (target_has_all_memory): Rewrite to call target_has_all_memory_1. (target_has_memory): Rewrite to call target_has_memory_1. (target_has_stack): Rewrite to call target_has_all_stack_1. (target_has_registers): Rewrite to call target_has_registers_1. (target_has_execution): Rewrite to call target_has_execution_1. (default_child_has_all_memory, default_child_has_memory) (default_child_has_stack, default_child_has_registers) (default_child_has_execution): Declare. (target_mark_running, target_mark_exited): Delete declarations. * target.c (default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution): New. (target_has_all_memory_1, target_has_memory_1, target_has_stack_1, target_has_registers_1, target_has_execution_1): New. (add_target): Default the to_has_all_memory, to_has_all_memory, to_has_memory, to_has_stack, to_has_registers and to_has_execution callbacks to return 0. (update_current_target): Do not inherit to_has_all_memory, to_has_memory, to_has_stack, to_has_registers or to_has_execution. (target_mark_running, target_mark_exited): Delete. (memory_xfer_partial): Adjust. (target_read_memory, target_write_memory, target_search_memory): Dispatch to the the top-most target, not the flattened current_target. (target_info): Adjust. (init_dummy_target): Install return_zero as callback for to_has_all_memory, to_has_memory, to_has_stack, to_has_registers, to_has_execution. (set_maintenance_target_async_permitted): Use have_live_inferiors instead of target_has_execution. * target-memory.c (target_write_memory_blocks): Dispatch memory writes to the the top-most target, not the flattened current_target. * breakpoint.c (insert_breakpoints): Don't check for target_has_execution here. (update_global_location_list): Check if there are live inferiors to debug instead of target_has_execution. * infcmd.c (kill_command, detach_command): Check if there are inferiors instead of target_has_execution. * inferior.h (have_live_inferiors): Declare. * inferior.c (have_live_inferiors): New. * infrun.c (normal_stop): Don't check for target_has_execution to finish the thread states. * thread.c (is_thread_state, is_stopped, is_exited, is_running) (any_running, is_executing): Remove checks for target_has_execution. * top.c (kill_or_detach): Don't try to kill core inferiors. (quit_target): Don't check for target_has_execution. * corelow.c (core_has_memory, core_has_stack, core_has_registers): New. (init_core_ops): Install core_has_memory, core_has_stack and core_has_registers. * exec.c (exec_has_memory): New. (init_exec_ops): Install exec_has_memory. * remote.c (remote_add_inferior): Don't call target_mark_running. (remote_start_remote): Don't call target_mark_exited or call target_mark_running. (remote_open_1): Use have_inferiors instead of target_has_execution. Don't use target_mark_exited. (init_remote_ops): Install deafult_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution. * bsd-kvm.c (bsd_kvm_return_one): New. (bsd_kvm_add_target): Register bsd_kvm_return_one as to_has_memory, to_has_stack and to_has_registers callbacks. * remote-m32r-sdi.c (m32r_return_one): New. (init_m32r_ops): Register it. * inf-child.c (inf_child_target): Adjust to register default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution callbacks. * gnu-nat.c (init_gnu_ops): Likewise. * go32-nat.c (init_go32_ops): Likewise. * hpux-thread.c (init_hpux_thread_ops): Likewise. * monitor.c (init_base_monitor_ops): Likewise. * nto-procfs.c (init_procfs_ops): Likewise. * remote-mips.c (_initialize_remote_mips): Likewise. * windows-nat.c (init_windows_ops): Likewise. * remote-sim.c (gdbsim_create_inferior): Don't use target_mark_running or target_mark_exited. (gdbsim_mourn_inferior): Don't call target_mark_exited. (init_gdbsim_ops): Adjust to register default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution callbacks. * linux-nat.c (linux_nat_xfer_partial): If reading memory, and there's no inferior selected, defer to a lower stratum.
2009-06-07 18:46:48 +02:00
/* If we still have other inferiors to debug, then don't mess with
with their threads. */
if (!have_inferiors ())
{
init_thread_list (); /* Destroy thread info */
/* Killing off the inferior can leave us with a core file. If
so, print the state we are left in. */
if (target_has_stack)
{
printf_filtered (_("In %s,\n"), target_longname);
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
}
}
bfd_cache_close_all ();
}
1999-07-07 22:19:36 +02:00
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
/* Used in `attach&' command. ARG is a point to an integer
representing a process id. Proceed threads of this process iff
they stopped due to debugger request, and when they did, they
reported a clean stop (TARGET_SIGNAL_0). Do not proceed threads
that have been explicitly been told to stop. */
static int
proceed_after_attach_callback (struct thread_info *thread,
void *arg)
{
int pid = * (int *) arg;
if (ptid_get_pid (thread->ptid) == pid
&& !is_exited (thread->ptid)
&& !is_executing (thread->ptid)
&& !thread->stop_requested
&& thread->stop_signal == TARGET_SIGNAL_0)
{
switch_to_thread (thread->ptid);
clear_proceed_status ();
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
}
return 0;
}
static void
proceed_after_attach (int pid)
{
/* Don't error out if the current thread is running, because
there may be other stopped threads. */
struct cleanup *old_chain;
/* Backup current thread and selected frame. */
old_chain = make_cleanup_restore_current_thread ();
iterate_over_threads (proceed_after_attach_callback, &pid);
/* Restore selected ptid. */
do_cleanups (old_chain);
}
/*
* TODO:
* Should save/restore the tty state since it might be that the
* program to be debugged was started on this tty and it wants
* the tty in some state other than what we want. If it's running
* on another terminal or without a terminal, then saving and
* restoring the tty state is a harmless no-op.
* This only needs to be done if we are attaching to a process.
*/
/*
attach_command --
takes a program started up outside of gdb and ``attaches'' to it.
This stops it cold in its tracks and allows us to start debugging it.
and wait for the trace-trap that results from attaching. */
static void
attach_command_post_wait (char *args, int from_tty, int async_exec)
{
char *exec_file;
char *full_exec_path = NULL;
struct inferior *inferior;
inferior = current_inferior ();
inferior->stop_soon = NO_STOP_QUIETLY;
/* If no exec file is yet known, try to determine it from the
process itself. */
exec_file = (char *) get_exec_file (0);
if (!exec_file)
{
exec_file = target_pid_to_exec_file (PIDGET (inferior_ptid));
if (exec_file)
{
/* It's possible we don't have a full path, but rather just a
filename. Some targets, such as HP-UX, don't provide the
full path, sigh.
Attempt to qualify the filename against the source path.
(If that fails, we'll just fall back on the original
filename. Not much more we can do...)
*/
if (!source_full_path_of (exec_file, &full_exec_path))
full_exec_path = xstrdup (exec_file);
exec_file_attach (full_exec_path, from_tty);
symbol_file_add_main (full_exec_path, from_tty);
}
}
else
{
reopen_exec_file ();
reread_symbols ();
}
/* Take any necessary post-attaching actions for this platform. */
target_post_attach (PIDGET (inferior_ptid));
post_create_inferior (&current_target, from_tty);
/* Install inferior's terminal modes. */
target_terminal_inferior ();
if (async_exec)
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
{
/* The user requested an `attach&', so be sure to leave threads
that didn't get a signal running. */
/* Immediatelly resume all suspended threads of this inferior,
and this inferior only. This should have no effect on
already running threads. If a thread has been stopped with a
signal, leave it be. */
if (non_stop)
proceed_after_attach (inferior->pid);
else
{
if (inferior_thread ()->stop_signal == TARGET_SIGNAL_0)
{
clear_proceed_status ();
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
}
}
}
else
{
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
/* The user requested a plain `attach', so be sure to leave
the inferior stopped. */
if (target_can_async_p ())
async_enable_stdin ();
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
/* At least the current thread is already stopped. */
/* In all-stop, by definition, all threads have to be already
stopped at this point. In non-stop, however, although the
selected thread is stopped, others may still be executing.
Be sure to explicitly stop all threads of the process. This
should have no effect on already stopped threads. */
if (non_stop)
target_stop (pid_to_ptid (inferior->pid));
/* Tell the user/frontend where we're stopped. */
normal_stop ();
if (deprecated_attach_hook)
deprecated_attach_hook ();
}
}
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct attach_command_continuation_args
{
char *args;
int from_tty;
int async_exec;
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
};
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
static void
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
attach_command_continuation (void *args)
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
{
struct attach_command_continuation_args *a = args;
attach_command_post_wait (a->args, a->from_tty, a->async_exec);
}
2008-07-12 Pedro Alves <pedro@codesourcery.com> 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.
2008-07-12 21:25:42 +02:00
static void
attach_command_continuation_free_args (void *args)
{
struct attach_command_continuation_args *a = args;
xfree (a->args);
xfree (a);
}
void
2000-07-30 03:48:28 +02:00
attach_command (char *args, int from_tty)
{
int async_exec = 0;
struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
1999-07-07 22:19:36 +02:00
dont_repeat (); /* Not for the faint of heart */
if (gdbarch_has_global_solist (target_gdbarch))
/* Don't complain if all processes share the same symbol
space. */
;
else if (target_has_execution)
{
if (query (_("A program is being debugged already. Kill it? ")))
target_kill ();
else
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Not killed."));
}
gdb/ 2006-09-21 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> * Makefile.in (SFILES): Add memory-map.c and xml-support.c. (memory_map_h, xml_support_h): New. (target_h): Add vec_h dependency. (COMMON_OBS): Add memory-map.o and xml-support.o. (memory-map.o, xml-support.o): New rules. (remote.o): Update. * exceptions.h (enum errors): Add XML_PARSE_ERROR. * infcmd.c (run_command_1, attach_command): Call target_pre_inferior. * memattr.c (default_mem_attrib): Initialize blocksize. (target_mem_region_list, mem_use_target) (target_mem_regions_valid, mem_region_cmp, mem_region_init) (require_user_regions, require_target_regions) (invalidate_target_mem_regions): New. (create_mem_region): Use mem_region_init. (mem_clear): Move higher. (lookup_mem_region): Use require_target_regions. (mem_command): Implement "mem auto". (mem_info_command): Handle target-supplied regions and flash attributes. (mem_enable_command, mem_disable_command, mem_delete_command): Use require_user_regions. (_initialize_mem): Mention "mem auto" in help. * memattr.h (enum mem_access_mode): Add MEM_FLASH. (struct mem_attrib): Add blocksize. (invalidate_target_mem_regions, mem_region_init, mem_region_cmp): New prototypes. * remote.c: Include "memory-map.h". (PACKET_qXfer_memory_map): New enum value. (remote_protocol_features): Add qXfer:memory-map:read. (remote_xfer_partial): Handle memory maps. (remote_memory_map): New. (init_remote_ops, init_remote_async_ops): Set to_memory_map. (_initialize_remote): Register qXfer:memory-map:read. * target.c (update_current_target): Mention to_memory_map. (target_memory_map, target_pre_inferior): New. (target_preopen): Call target_pre_inferior. * target.h: Include "vec.h". (enum target_object): Add TARGET_OBJECT_MEMORY_MAP. (struct target_ops): Add to_memory_map. (target_memory_map, target_pre_inferior): New prototypes. * memory-map.c, memory-map.h, xml-support.c, xml-support.h: New files. gdb/doc/ 2006-09-21 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> * gdb.texinfo (Memory Region Attributes): Mention target-supplied memory regions and "mem auto".
2006-09-21 15:54:03 +02:00
/* Clean up any leftovers from other runs. Some other things from
this function should probably be moved into target_pre_inferior. */
target_pre_inferior (from_tty);
if (non_stop && !target_supports_non_stop ())
error (_("Cannot attach to this target in non-stop mode"));
if (args)
{
async_exec = strip_bg_char (&args);
/* If we get a request for running in the bg but the target
doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
}
/* If we don't get a request of running in the bg, then we need
to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
{
/* Simulate synchronous execution */
async_disable_stdin ();
make_cleanup ((make_cleanup_ftype *)async_enable_stdin, NULL);
}
target_attach (args, from_tty);
/* Set up the "saved terminal modes" of the inferior
based on what modes we are starting it with. */
target_terminal_init ();
/* Set up execution context to know that we should return from
wait_for_inferior as soon as the target reports a stop. */
init_wait_for_inferior ();
clear_proceed_status ();
Remote non-stop mode support. * remote.c (pending_stop_reply): New. (struct remote_state) <non_stop_aware, support_vCont_t>: New fields. (remote_async_inferior_event_token) (remote_async_get_pending_events_token): New. (notice_new_inferiors): New, abstracted out from record_currthread. (record_currthread): Call it. (remote_threads_info): Default threads to running in non-stop mode. In non-stop mode, only qfThreadInfo is supported. (remote_close): Discard all pending stop_replies. Close the event sources. (set_stop_requested_callback): New. (remote_start_remote): Implement non-stop mode startup. In all-stop, don't clear the thread list here. (remote_non_stop_feature): New. (remote_protocol_features): Add a "QNonStop" feature. (remote_open_1): Clear cached_wait_status and non_stop_aware. Clear the thread list here. (remote_detach_1): Discard pending stop replies of the process we detached from. (extended_remote_attach_1): Implement non-stop mode. (remote_vcont_probe): Recognize `vCont;t'. (remote_vcont_resume): Implement non-stop mode. (remote_resume): Don't set waiting_for_stop_reply in non-stop mode. (remote_stop_ns): New. (remote_stop): Rename to ... (remote_stop_as): ... this. If we have a cached wait status, don't bother interrupting the remote. (remote_stop): Reimplement as wrapper around remote_stop_as and remote_stop_ns. (interrupt_query): Don't query in async mode. (struct cached_reg, cahed_reg_t): New. (struct stop_reply): New. (stop_reply_queue): New. (stop_reply_xmalloc, stop_reply_xfree) (discard_pending_stop_replies, do_stop_reply_xfree) (queued_stop_reply, push_stop_reply, peek_stop_reply) (remote_parse_stop_reply, remote_get_pending_stop_replies) (process_stop_reply): New. (remote_wait_ns): New. (remote_wait_as): Use remote_parse_stop_reply. Invalidate the notion of current general thread is a process exit was reported. (remote_wait): Call remote_wait_ns in non-stop mode. (handle_notification): New. (putpkt_binary): Handle notifications. Don't care for waiting_for_stop_reply in non-stop mode. (getpkt_sane): Rename to ... (getpkt_or_notif_sane_1): ... this. Add `expecting_notif' argument. Handle it. Handle notifications. (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1. (getpkt_or_notif_sane): New. (select_new_thread_callback): Check for exited state instead of comparing the ptid against minus_one_ptid. (extended_remote_create_inferior_1): Query the remote about the current thread. (remote_supports_non_stop): New. (init_remote_ops): Register it. (remote_async_inferior_event_handler): New. (remote_async_get_pending_events_handler): New. * infcmd.c (proceed_thread_callback): Comment. (proceed_after_attach_callback, proceed_after_attach): New. (attach_command_post_wait): In background attach, resume all threads, but only if they are unsignalled, and not explicitly stopped. In foreground attach, in non-stop mode, make sure to stop all threads of the just attached to process. (attach_command): In non-stop mode: If doing a background attach, stop at least one thread. If a foreground attach, stop all threads.
2008-10-24 22:38:26 +02:00
if (non_stop)
{
/* If we find that the current thread isn't stopped, explicitly
do so now, because we're going to install breakpoints and
poke at memory. */
if (async_exec)
/* The user requested an `attach&'; stop just one thread. */
target_stop (inferior_ptid);
else
/* The user requested an `attach', so stop all threads of this
inferior. */
target_stop (pid_to_ptid (ptid_get_pid (inferior_ptid)));
}
/* Some system don't generate traps when attaching to inferior.
E.g. Mach 3 or GNU hurd. */
if (!target_attach_no_wait)
1999-07-07 22:19:36 +02:00
{
struct inferior *inferior = current_inferior ();
/* Careful here. See comments in inferior.h. Basically some
OSes don't ignore SIGSTOPs on continue requests anymore. We
need a way for handle_inferior_event to reset the stop_signal
variable after an attach, and this is what
STOP_QUIETLY_NO_SIGSTOP is for. */
inferior->stop_soon = STOP_QUIETLY_NO_SIGSTOP;
1999-07-07 22:19:36 +02:00
if (target_can_async_p ())
{
/* sync_execution mode. Wait for stop. */
Replace struct continuation_args by void* and per command structs. * 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".
2008-07-12 21:07:38 +02:00
struct attach_command_continuation_args *a;
a = xmalloc (sizeof (*a));
a->args = xstrdup (args);
a->from_tty = from_tty;
a->async_exec = async_exec;
add_inferior_continuation (attach_command_continuation, a,
attach_command_continuation_free_args);
discard_cleanups (back_to);
return;
}
wait_for_inferior (0);
}
1999-09-28 23:55:21 +02:00
attach_command_post_wait (args, from_tty, async_exec);
discard_cleanups (back_to);
}
/* We had just found out that the target was already attached to an
inferior. PTID points at a thread of this new inferior, that is
the most likely to be stopped right now, but not necessarily so.
The new inferior is assumed to be already added to the inferior
list at this point. If LEAVE_RUNNING, then leave the threads of
this inferior running, except those we've explicitly seen reported
as stopped. */
void
notice_new_inferior (ptid_t ptid, int leave_running, int from_tty)
{
struct cleanup* old_chain;
int async_exec;
old_chain = make_cleanup (null_cleanup, NULL);
/* If in non-stop, leave threads as running as they were. If
they're stopped for some reason other than us telling it to, the
target reports a signal != TARGET_SIGNAL_0. We don't try to
resume threads with such a stop signal. */
async_exec = non_stop;
if (!ptid_equal (inferior_ptid, null_ptid))
make_cleanup_restore_current_thread ();
switch_to_thread (ptid);
/* When we "notice" a new inferior we need to do all the things we
would normally do if we had just attached to it. */
if (is_executing (inferior_ptid))
{
struct inferior *inferior = current_inferior ();
/* We're going to install breakpoints, and poke at memory,
ensure that the inferior is stopped for a moment while we do
that. */
target_stop (inferior_ptid);
inferior->stop_soon = STOP_QUIETLY_REMOTE;
/* Wait for stop before proceeding. */
if (target_can_async_p ())
{
struct attach_command_continuation_args *a;
a = xmalloc (sizeof (*a));
a->args = xstrdup ("");
a->from_tty = from_tty;
a->async_exec = async_exec;
add_inferior_continuation (attach_command_continuation, a,
attach_command_continuation_free_args);
do_cleanups (old_chain);
return;
}
else
wait_for_inferior (0);
}
async_exec = leave_running;
attach_command_post_wait ("" /* args */, from_tty, async_exec);
do_cleanups (old_chain);
}
/*
* detach_command --
* takes a program previously attached to and detaches it.
* The program resumes execution and will no longer stop
* on signals, etc. We better not have left any breakpoints
* in the program or it'll die when it hits one. For this
* to work, it may be necessary for the process to have been
* previously attached. It *might* work if the program was
* started via the normal ptrace (PTRACE_TRACEME).
*/
void
2000-07-30 03:48:28 +02:00
detach_command (char *args, int from_tty)
{
dont_repeat (); /* Not for the faint of heart. */
2009-03-25 22:42:35 +01:00
if (ptid_equal (inferior_ptid, null_ptid))
error (_("The program is not being run."));
disconnect_tracing (from_tty);
2010-01-06 21:31:28 +01:00
target_detach (args, from_tty);
/* If the solist is global across inferiors, don't clear it when we
detach from a single inferior. */
if (!gdbarch_has_global_solist (target_gdbarch))
no_shared_libraries (NULL, from_tty);
* target.h (struct target_ops): Make to_has_all_memory, to_has_memory, to_has_stack, to_has_registers and to_has_execution methods instead of variables. (target_has_all_memory_1, target_has_memory_1, target_has_stack_1) (target_has_registers_1, target_has_execution_1): Declare functions. (target_has_all_memory): Rewrite to call target_has_all_memory_1. (target_has_memory): Rewrite to call target_has_memory_1. (target_has_stack): Rewrite to call target_has_all_stack_1. (target_has_registers): Rewrite to call target_has_registers_1. (target_has_execution): Rewrite to call target_has_execution_1. (default_child_has_all_memory, default_child_has_memory) (default_child_has_stack, default_child_has_registers) (default_child_has_execution): Declare. (target_mark_running, target_mark_exited): Delete declarations. * target.c (default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution): New. (target_has_all_memory_1, target_has_memory_1, target_has_stack_1, target_has_registers_1, target_has_execution_1): New. (add_target): Default the to_has_all_memory, to_has_all_memory, to_has_memory, to_has_stack, to_has_registers and to_has_execution callbacks to return 0. (update_current_target): Do not inherit to_has_all_memory, to_has_memory, to_has_stack, to_has_registers or to_has_execution. (target_mark_running, target_mark_exited): Delete. (memory_xfer_partial): Adjust. (target_read_memory, target_write_memory, target_search_memory): Dispatch to the the top-most target, not the flattened current_target. (target_info): Adjust. (init_dummy_target): Install return_zero as callback for to_has_all_memory, to_has_memory, to_has_stack, to_has_registers, to_has_execution. (set_maintenance_target_async_permitted): Use have_live_inferiors instead of target_has_execution. * target-memory.c (target_write_memory_blocks): Dispatch memory writes to the the top-most target, not the flattened current_target. * breakpoint.c (insert_breakpoints): Don't check for target_has_execution here. (update_global_location_list): Check if there are live inferiors to debug instead of target_has_execution. * infcmd.c (kill_command, detach_command): Check if there are inferiors instead of target_has_execution. * inferior.h (have_live_inferiors): Declare. * inferior.c (have_live_inferiors): New. * infrun.c (normal_stop): Don't check for target_has_execution to finish the thread states. * thread.c (is_thread_state, is_stopped, is_exited, is_running) (any_running, is_executing): Remove checks for target_has_execution. * top.c (kill_or_detach): Don't try to kill core inferiors. (quit_target): Don't check for target_has_execution. * corelow.c (core_has_memory, core_has_stack, core_has_registers): New. (init_core_ops): Install core_has_memory, core_has_stack and core_has_registers. * exec.c (exec_has_memory): New. (init_exec_ops): Install exec_has_memory. * remote.c (remote_add_inferior): Don't call target_mark_running. (remote_start_remote): Don't call target_mark_exited or call target_mark_running. (remote_open_1): Use have_inferiors instead of target_has_execution. Don't use target_mark_exited. (init_remote_ops): Install deafult_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution. * bsd-kvm.c (bsd_kvm_return_one): New. (bsd_kvm_add_target): Register bsd_kvm_return_one as to_has_memory, to_has_stack and to_has_registers callbacks. * remote-m32r-sdi.c (m32r_return_one): New. (init_m32r_ops): Register it. * inf-child.c (inf_child_target): Adjust to register default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution callbacks. * gnu-nat.c (init_gnu_ops): Likewise. * go32-nat.c (init_go32_ops): Likewise. * hpux-thread.c (init_hpux_thread_ops): Likewise. * monitor.c (init_base_monitor_ops): Likewise. * nto-procfs.c (init_procfs_ops): Likewise. * remote-mips.c (_initialize_remote_mips): Likewise. * windows-nat.c (init_windows_ops): Likewise. * remote-sim.c (gdbsim_create_inferior): Don't use target_mark_running or target_mark_exited. (gdbsim_mourn_inferior): Don't call target_mark_exited. (init_gdbsim_ops): Adjust to register default_child_has_all_memory, default_child_has_memory, default_child_has_stack, default_child_has_registers, default_child_has_execution callbacks. * linux-nat.c (linux_nat_xfer_partial): If reading memory, and there's no inferior selected, defer to a lower stratum.
2009-06-07 18:46:48 +02:00
/* If we still have inferiors to debug, then don't mess with their
threads. */
if (!have_inferiors ())
init_thread_list ();
2004-04-21 Andrew Cagney <cagney@redhat.com> * annotate.h (deprecated_annotate_starting_hook) (deprecated_annotate_stopped_hook) (deprecated_annotate_exited_hook) (deprecated_annotate_signal_hook) (deprecated_annotate_signalled_hook): Deprecate. * tracepoint.h (deprecated_create_tracepoint_hook) (deprecated_delete_tracepoint_hook) (deprecated_modify_tracepoint_hook) (deprecated_trace_find_hook) (deprecated_trace_start_stop_hook): Deprecate. * target.h (deprecated_target_new_objfile_hook): Deprecate. * remote.h (deprecated_target_resume_hook) (deprecated_target_wait_loop_hook): Deprecate. * gdbcore.h (deprecated_exec_file_display_hook) (deprecated_file_changed_hook): Deprecate. * frame.h (deprecated_selected_frame_level_changed_hook): Deprecate. * defs.h (deprecated_modify_breakpoint_hook) (deprecated_command_loop_hook, deprecated_show_load_progress) (deprecated_print_frame_info_listing_hook) (deprecated_query_hook, deprecated_warning_hook) (deprecated_flush_hook, deprecated_create_breakpoint_hook) (deprecated_delete_breakpoint_hook) (deprecated_interactive_hook, deprecated_registers_changed_hook) (deprecated_readline_begin_hook, deprecated_readline_hook) (deprecated_readline_end_hook, deprecated_register_changed_hook) (deprecated_memory_changed_hook, deprecated_init_ui_hook) (deprecated_context_hook, deprecated_target_wait_hook) (deprecated_attach_hook, deprecated_detach_hook) (deprecated_call_command_hook, deprecated_set_hook) (deprecated_error_hook, deprecated_error_begin_hook) (deprecated_ui_load_progress_hook): Deprecate. * valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update. * tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update. * target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update. * remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update. * main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update. * exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update. * cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update. * annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
if (deprecated_detach_hook)
deprecated_detach_hook ();
}
/* Disconnect from the current target without resuming it (leaving it
waiting for a debugger).
We'd better not have left any breakpoints in the program or the
next debugger will get confused. Currently only supported for some
remote targets, since the normal attach mechanisms don't work on
stopped processes on some native platforms (e.g. GNU/Linux). */
static void
disconnect_command (char *args, int from_tty)
{
dont_repeat (); /* Not for the faint of heart */
target_disconnect (args, from_tty);
no_shared_libraries (NULL, from_tty);
init_thread_list ();
2004-04-21 Andrew Cagney <cagney@redhat.com> * annotate.h (deprecated_annotate_starting_hook) (deprecated_annotate_stopped_hook) (deprecated_annotate_exited_hook) (deprecated_annotate_signal_hook) (deprecated_annotate_signalled_hook): Deprecate. * tracepoint.h (deprecated_create_tracepoint_hook) (deprecated_delete_tracepoint_hook) (deprecated_modify_tracepoint_hook) (deprecated_trace_find_hook) (deprecated_trace_start_stop_hook): Deprecate. * target.h (deprecated_target_new_objfile_hook): Deprecate. * remote.h (deprecated_target_resume_hook) (deprecated_target_wait_loop_hook): Deprecate. * gdbcore.h (deprecated_exec_file_display_hook) (deprecated_file_changed_hook): Deprecate. * frame.h (deprecated_selected_frame_level_changed_hook): Deprecate. * defs.h (deprecated_modify_breakpoint_hook) (deprecated_command_loop_hook, deprecated_show_load_progress) (deprecated_print_frame_info_listing_hook) (deprecated_query_hook, deprecated_warning_hook) (deprecated_flush_hook, deprecated_create_breakpoint_hook) (deprecated_delete_breakpoint_hook) (deprecated_interactive_hook, deprecated_registers_changed_hook) (deprecated_readline_begin_hook, deprecated_readline_hook) (deprecated_readline_end_hook, deprecated_register_changed_hook) (deprecated_memory_changed_hook, deprecated_init_ui_hook) (deprecated_context_hook, deprecated_target_wait_hook) (deprecated_attach_hook, deprecated_detach_hook) (deprecated_call_command_hook, deprecated_set_hook) (deprecated_error_hook, deprecated_error_begin_hook) (deprecated_ui_load_progress_hook): Deprecate. * valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update. * tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update. * target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update. * remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update. * main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update. * exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update. * cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update. * annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
if (deprecated_detach_hook)
deprecated_detach_hook ();
}
void
interrupt_target_1 (int all_threads)
{
ptid_t ptid;
if (all_threads)
ptid = minus_one_ptid;
else
ptid = inferior_ptid;
target_stop (ptid);
/* Tag the thread as having been explicitly requested to stop, so
other parts of gdb know not to resume this thread automatically,
if it was stopped due to an internal event. Limit this to
non-stop mode, as when debugging a multi-threaded application in
all-stop mode, we will only get one stop event --- it's undefined
which thread will report the event. */
if (non_stop)
set_stop_requested (ptid, 1);
}
1999-07-05 19:58:44 +02:00
/* Stop the execution of the target while running in async mode, in
the backgound. In all-stop, stop the whole process. In non-stop
mode, stop the current thread only by default, or stop all threads
if the `-a' switch is used. */
/* interrupt [-a] */
2000-02-03 05:14:45 +01:00
void
2000-07-30 03:48:28 +02:00
interrupt_target_command (char *args, int from_tty)
1999-07-05 19:58:44 +02:00
{
if (target_can_async_p ())
1999-07-05 19:58:44 +02:00
{
int all_threads = 0;
1999-07-07 22:19:36 +02:00
dont_repeat (); /* Not for the faint of heart */
Non-stop inferior control. * infrun.c (resume): In non-stop mode, always resume just one thread. (proceed): Don't call prepare_to_proceed in non-stop mode. (fetch_inferior_event): In non-stop mode, switch context before handling the event. (error_is_running, ensure_not_running): New. (handle_inferior_event): In non-stop mode: Mark only the event thread as stopped. Require that the target module manages adding threads to the thread list. Assert that there isn't a deferred_step_ptid set. Don't switch to infwait_thread_hop_state. (normal_stop): Only mark not-running if inferior hasn't exited. In non-stop mode, only mark the event thread. * thread.c:Include "cli/cli-decode.h". (print_thread_info): Don't read from a running thread. Output "(running)" if thread is running. (switch_to_thread): Don't read stop_pc if thread is executing. (do_restore_current_thread_cleanup): Don't write to a running thread. (thread_apply_all_command): Don't read from a running thread. In non-stop mode, do a full context-switch instead of just switching threads. (thread_apply_command): In non-stop mode, do a full context-switch instead of just switching threads. (do_captured_thread_select): Likewise. Inform user if selected thread is running. (_initialize_thread): Mark "info threads" and "thread" and async_ok. * inf-loop.c (inferior_event_handler): In non-stop mode, don't unregister the target from the event loop. * infcmd.c (continue_command, step_1, jump_command) (signal_command): Ensure the selected thread isn't running. (interrupt_target_command): In non-stop mode, interrupt only the selected thread. * inferior.h (error_is_running, ensure_not_running): Declare. * target.h (struct target_ops): Add ptid argument to the to_stop member. (target_stop): Add ptid_t argument. * target.c (update_current_target): Add ptid argument to to_stop's type. (debug_to_stop): Add ptid_t argument. (debug_to_rcmd): Set to_stop_ptid. * remote.c (remote_stop): Add ptid_t argument. (async_remote_interrupt): Add inferior_ptid to target_stop. * inf-ptrace.c (inf_ptrace_stop): Add ptid argument. * Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
if (args != NULL
&& strncmp (args, "-a", sizeof ("-a") - 1) == 0)
all_threads = 1;
if (!non_stop && all_threads)
error (_("-a is meaningless in all-stop mode."));
interrupt_target_1 (all_threads);
1999-07-05 19:58:44 +02:00
}
}
static void
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
print_float_info (struct ui_file *file,
struct frame_info *frame, const char *args)
{
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_print_float_info_p (gdbarch))
gdbarch_print_float_info (gdbarch, file, frame, args);
else
{
int regnum;
int printed_something = 0;
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
for (regnum = 0;
regnum < gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch);
2007-05-31 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers) (inf_ptrace_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * i386-linux-nat.c (supply_gregset, fill_gregset) (i386_linux_fetch_inferior_registers) (i386_linux_store_inferior_registers): Likewise. * remote.c (init_remote_state,packet_reg_from_regnum) (packet_reg_from_pnum,process_g_packet,remote_fetch_registers) (remote_prepare_to_store,store_registers_using_G) (remote_store_registers,remote_arch_state): Likewise. * tracepoint.c (encode_actions): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * tui/tui-regs.c (tui_show_register_group) (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * xtensa-tdep.c (xtensa_register_name,xtensa_register_type) (xtensa_reg_to_regnum,xtensa_pseudo_register_read) (xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers) (do_win32_store_inferior_registers,fetch_elf_core_registers * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target-descriptions.c (tdesc_use_registers): Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register) (sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * rs6000-nat.c (fetch_register,store_register): Likewise. * remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register) (gdbsim_fetch_register,gdbsim_store_register): Likewise. * remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers) (m32r_store_registers): Likewise. * reggroups.c (default_register_reggroup_p): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save) (regcache_restore,regcache_dump): Likewise. * monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise. * mips-tdep.c (mips_xfer_register,mips_register_name) (mips_register_reggroup_p,mips_pseudo_register_read) (mips_pseudo_register_write,mips_convert_register_p,mips_register_type) (mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset) (mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs) (mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg) (mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value) (print_gp_register_row,mips_print_registers_info) (mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_register_sim_regno): Likewise. * mips-linux-tdep.c (mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Likewise. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register) (ia64_cannot_store_register,ia64_linux_fetch_registers) (ia64_linux_store_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Likewise. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM) (h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register) (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache) (dwarf2_frame_state_alloc_regs): Likewise. * cris-tdep.c (cris_register_size,cris_cannot_fetch_register) (cris_cannot_store_register,crisv32_cannot_fetch_register) (crisv32_cannot_store_register,cris_register_name): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * arch-utils.c (legacy_register_sim_regno) (legacy_virtual_frame_pointer): Likewise. * arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise. * arm-tdep.h: Likewise (comment). * frv-tdep.c (frv_register_sim_regno): Likewise. * m68klinux-nat.c (old_fetch_inferior_registers) (old_store_inferior_registers): Likewise. * m32c-tdep.c (m32c_virtual_frame_pointer): Likewise. * irix5-nat.c (fetch_core_registers): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * hppa-linux-nat.c (hppa_linux_register_addr) (hppa_linux_fetch_inferior_registers) (hppa_linux_store_inferior_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers) (hppa_hpux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_native_gregset_reg_offset) (amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise. * dbug-rom.c (dbug_regname): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache) (HARD_PAGE_REGNUM (comment)): Likewise. * gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * tui/tui-regs.c (tui_show_register_group): Likewise. * xtensa-tdep.h (FP_ALIAS): Likewise. * user-regs.h: Likewise (comment). * user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * target-descriptions.h: Likewise (comment). * target.c (debug_print_register): Likewise. * stack.c (frame_info): Likewise. * stabsread.c (define_symbol): Likewise. * sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info) (sh64_compact_print_registers_info): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. * regcache.c (init_regcache_descr,register_size,regcache,regcache_save (regcache_restore,regcache_dump): Likewise. * mips-tdep.c (print_gp_register_row,mips_print_registers_info) (mips_dwarf_dwarf2_ecoff_reg_to_regnum) (mips_stab_reg_to_regnum): Likewise. * findvar.c (value_of_register): Likewise. * infcmd.c (default_print_registers_info,registers_info) (print_vector_info,print_float_info): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise. * xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum) (xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise. * parse.c: Remove comment. * gdbarch.c, gdbarch.h: Regenerate
2007-05-31 19:32:22 +02:00
regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
{
printed_something = 1;
gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
}
}
if (!printed_something)
fprintf_filtered (file, "\
No floating-point info available for this processor.\n");
}
}
static void
float_info (char *args, int from_tty)
{
if (!target_has_registers)
error (_("The program has no registers now."));
* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. * arm-tdep.c (arm_skip_prologue): Pass architecture to deprecated_pc_in_call_dummy. * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter. * breakpoint.c (expand_line_sal_maybe): Pass architecture to skip_prologue_using_sal. * arm-tdep.c (skip_prologue_using_sal): Likewise. * lm32-tdep.c (lm32_skip_prologue): Likewise. * m32-tdep.c (m32c_skip_prologue): Likewise. * mips-tdep.c (mips_skip_prologue): Likewise. * moxie-tdep.c (moxie_skip_prologue): Likewise. * mt-tdep.c (mt_frame_unwind_cache): Likewise. * rs6000-tdep.c (rs6000_skip_prologue): Likewise. * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass it to skip_prologue_using_sal. Update call sites ... (frv_skip_prologue, frv_frame_unwind_cache): ... here. * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member. (check_for_saved): Use it instead of current_gdbarch. (mn10300_analyze_prologue): Set it. * value.c (using_struct_return): Add GDBARCH parameter. Use it instead of current_gdbarch. * value.h (using_struct_return): Add GDBARCH parameter. * eval.c (evaluate_subexp_standard): Pass architecture to using_struct_return. * infcall.c (call_function_by_hand): Likewise. * stack.c (return_command): Likewise. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. * symtab.c (in_prologue): Add GDBARCH parameter. Use it instead of current_gdbarch. * symtab.h (in_prologue): Add GDBARCH parameter. * infrun.c (handle_inferior_event): Pass architecture to in_prologue. * eval.c (evaluate_subexp_standard): Use expression architecture instead of current_gdbarch. * c-lang.c (evaluate_subexp_c): Use expression architecture and language instead of current_gdbarch and current_language. * printcmd.c (do_one_display): Use expression architecture instead of current_gdbarch. * infcmd.c (print_return_value): Use architecture of stop_regcache instead of current_gdbarch. (print_vector_info, print_float_info): Remove GDBARCH argument, use frame architecture instead. (vector_info, float_info): Update calls. * objc-lang.c (objc_skip_trampoline): Use frame architecture instead of current_gdbarch. * parse.c (write_dollar_variable): Use parse architecture instead of current_gdbarch. * source.c (line_info): Use objfile architecture instead of current_gdbarch. * symtab.c (find_function_start_sal): Use gdbarch instead of current_gdbarch. (print_msymbol_info): Use objfile architecture instead of current_gdbarch. * valops.c (value_assign): Use frame architecture instead of current_gdbarch.
2009-06-17 20:43:24 +02:00
print_float_info (gdb_stdout, get_selected_frame (NULL), args);
}
static void
2000-07-30 03:48:28 +02:00
unset_command (char *args, int from_tty)
{
printf_filtered (_("\
\"unset\" must be followed by the name of an unset subcommand.\n"));
help_list (unsetlist, "unset ", -1, gdb_stdout);
}
void
2000-07-30 03:48:28 +02:00
_initialize_infcmd (void)
{
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
struct cmd_list_element *c = NULL;
/* add the filename of the terminal connected to inferior I/O */
add_setshow_filename_cmd ("inferior-tty", class_run,
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
&inferior_io_terminal_scratch, _("\
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
Set terminal for future runs of program being debugged."), _("\
Show terminal for future runs of program being debugged."), _("\
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
Usage: set inferior-tty /dev/pts/1"),
set_inferior_tty_command,
show_inferior_tty_command,
&setlist, &showlist);
Index: gdb/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * fork-child.c (fork-inferior): Use accessor function for + inferior_io_terminal. + * infcmd.c (inferior_io_terminal): Make static. + (set_inferior_io_terminal): New function. + (get_inferior_io_terminal): Ditto. + (tty_command): Use accessor function. + (_initialize_infcmd): Add inferior_tty setshow variable. + (_initialize_infcmd): Remove tty command. + (_initialize_infcmd): Add a tty command that is an alias. + * inferior.h (set_inferior_io_terminal): New prototype. + (get_inferior_io_terminal): Ditto. + (new_tty_prefork): Add const qualifier to parameter. + * inflow.c (inferior_thisrun_terminal): Add const qualifier. + (new_tty_prefork): Add const qualifier to parameter. + * nto-procfs (procfs_create_inferior): Use accessor function. + (procfs_create_inferior): Add const qualifier to locals. + * win32-nat.c (child_create_inferior): Ditto. + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function. + (mi_cmd_inferior_tty_set): Ditto. + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype. + (mi_cmd_inferior_tty_show): Ditto. Index: gdb/doc/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set + and -inferior-tty-show. + (Input/Output): Document "set/show inferior-tty" and tty alias. Index: gdb/testsuite/ChangeLog +2005-07-06 Bob Rossi <bob@brasko.net> + + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty + command. + (Copyright): Update copyright.
2005-07-06 16:54:37 +02:00
add_com_alias ("tty", "set inferior-tty", class_alias, 0);
add_setshow_optional_filename_cmd ("args", class_run,
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
&inferior_args_scratch, _("\
Set argument list to give program being debugged when it is started."), _("\
Show argument list to give program being debugged when it is started."), _("\
Follow this command with any number of args, to be passed to the program."),
Per-inferior args and tty and environment. * infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
2010-01-20 15:23:07 +01:00
set_args_command,
show_args_command,
&setlist, &showlist);
c = add_cmd ("environment", no_class, environment_info, _("\
The environment to give the program, or one variable's value.\n\
With an argument VAR, prints the value of environment variable VAR to\n\
give the program being debugged. With no arguments, prints the entire\n\
environment to be given to the program."), &showlist);
set_cmd_completer (c, noop_completer);
add_prefix_cmd ("unset", no_class, unset_command,
_("Complement to certain \"set\" commands."),
&unsetlist, "unset ", 0, &cmdlist);
1999-07-07 22:19:36 +02:00
c = add_cmd ("environment", class_run, unset_environment_command, _("\
Cancel environment variable VAR for the program.\n\
This does not affect the program until the next \"run\" command."),
1999-07-07 22:19:36 +02:00
&unsetlist);
set_cmd_completer (c, noop_completer);
c = add_cmd ("environment", class_run, set_environment_command, _("\
Set environment variable value to give the program.\n\
Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
VALUES of environment variables are uninterpreted strings.\n\
This does not affect the program until the next \"run\" command."),
1999-07-07 22:19:36 +02:00
&setlist);
set_cmd_completer (c, noop_completer);
1999-07-07 22:19:36 +02:00
c = add_com ("path", class_files, path_command, _("\
Add directory DIR(s) to beginning of search path for object files.\n\
$cwd in the path means the current working directory.\n\
This path is equivalent to the $PATH shell variable. It is a list of\n\
directories, separated by colons. These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed."));
set_cmd_completer (c, filename_completer);
c = add_cmd ("paths", no_class, path_info, _("\
Current search path for finding object files.\n\
$cwd in the path means the current working directory.\n\
This path is equivalent to the $PATH shell variable. It is a list of\n\
directories, separated by colons. These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed."),
&showlist);
set_cmd_completer (c, noop_completer);
gdb/ 2009-07-02 Pedro Alves <pedro@codesourcery.com> * linux-nat.c (linux_child_follow_fork): If we're staying attached to the child process, enable event reporting on it. Don't handle checkpoints here. Instead, add the child fork to the lwp thread and inferior lists without clobbering the previous inferior. Let the thread_db layer learn about a new child process, even if following the parent. (linux_nat_switch_fork): Delete lwps of the current inferior only, instead of clearing the whole list. Use thread_change_ptid to give the core the illusion the new checkpoint is still the same inferior. Clear the register cache. (linux_handle_extended_wait): Handle checkpoints here. (linux_multi_process): Turn on. * linux-fork.c (struct fork_info) <pc>: Remove field. (init_fork_list): Do not delete the checkpoint from the inferior list (it is not there). (fork_load_infrun_state): Don't switch inferior_ptid here. Pass the new checkpoint's ptid to linux_nat_switch_fork. (fork_save_infrun_state): Make static. Don't stop the pc field of fork_info, it's gone. (linux_fork_mourn_inferior): Don't delete the checkpoint from the inferior list, it's not there. (linux_fork_detach): Ditto. (delete_fork_command): Replace mention of fork/checkpoint by checkpoint only. (detach_fork_command): Likewise. Don't delete the checkpoint from the inferior list. (info_forks_command): Adjust. (restore_detach_fork): Delete. (checkpointing_pid): New. (linux_fork_checkpointing_p): New. (save_detach_fork): Delete. (checkpoint_command): Delete temp_detach_fork. Don't remove breakpoints, that's a nop. Store the pid of the process we're checkpointing, and use make_cleanup_restore_integer to restore it. Don't reinsert breakpoints here. (process_command, fork_command): Delete. (restart_command): Update comments to only mention checkpoints, not forks. (_initialize_linux_fork): Delete "fork", "process", "info forks" commands. * linux-fork.h (fork_save_infrun_state, fork_list): Delete declarations. (linux_fork_checkpointing_p): Declare. * cli/cli-cmds.c (killlist): New. * cli/cli-cmds.h (killlist): Declare. * gdbcmd.h (killlist): Declare. * inferior.c: Include "gdbthread.h". (detach_inferior_command, kill_inferior_command) (inferior_command): New. (info_inferiors_command): Allow specifying a specific inferior id. (_initialize_inferiors): Register "inferior", "kill inferior" and "detach inferior" commands. * infcmd.c (_initialize_infcmd): Make "kill" a prefix command. * gdbthread.h (any_thread_of_process): Declare. * thread.c (any_thread_of_process): New. * NEWS: Mention multi-inferior debugging. Mention 'info inferiors', 'inferior', 'detach inferior' and 'kill inferior' as new commands. (Removed commands): New section, mentioning that 'info forks', 'fork', 'process', 'delete fork' and 'detach fork' are now gone. gdb/testsuite/ 2009-07-02 Pedro Alves <pedro@codesourcery.com> * gdb.base/multi-forks.exp: Only run detach-on-fork tests on linux. Adjust to use "inferior", "info inferiors", "detach inferior" and "kill inferior" instead of "restart", "info fork", "detach fork" and "delete fork". * gdb.base/ending-run.exp: Spell out "info". * gdb.base/help.exp: Adjust to use test_prefix_command_help for the "kill" command. gdb/doc/ 2009-07-02 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (Debugging multiple inferiors): Document the "inferior", "detach inferior" and "kill inferior" commands. (Debugging Programs with Multiple Processes): Adjust to mention generic "inferior" commands. Delete mention of "detach fork" and "delete fork". Cross reference to "Debugging multiple inferiors" section.
2009-07-02 23:57:28 +02:00
add_prefix_cmd ("kill", class_run, kill_command,
_("Kill execution of program being debugged."),
&killlist, "kill ", 0, &cmdlist);
add_com ("attach", class_run, attach_command, _("\
Attach to a process or file outside of GDB.\n\
This command attaches to another target, of the same type as your last\n\
\"target\" command (\"info files\" will show your target stack).\n\
The command may take as argument a process id or a device file.\n\
For a process id, you must have permission to send the process a signal,\n\
and it must have the same effective uid as the debugger.\n\
When using \"attach\" with a process id, the debugger finds the\n\
program running in the process, looking first in the current working\n\
directory, or (if not found there) using the source file search path\n\
(see the \"directory\" command). You can also use the \"file\" command\n\
to specify the program, and to load its symbol table."));
add_prefix_cmd ("detach", class_run, detach_command, _("\
Detach a process or file previously attached.\n\
If a process, it is no longer traced, and it continues its execution. If\n\
you were debugging a file, the file is closed and gdb no longer accesses it."),
&detachlist, "detach ", 0, &cmdlist);
add_com ("disconnect", class_run, disconnect_command, _("\
Disconnect from a target.\n\
The target will wait for another debugger to connect. Not available for\n\
all targets."));
add_com ("signal", class_run, signal_command, _("\
Continue program giving it signal specified by the argument.\n\
An argument of \"0\" means continue program without giving it a signal."));
add_com ("stepi", class_run, stepi_command, _("\
Step one instruction exactly.\n\
Argument N means do this N times (or till program stops for another reason)."));
add_com_alias ("si", "stepi", class_alias, 0);
add_com ("nexti", class_run, nexti_command, _("\
Step one instruction, but proceed through subroutine calls.\n\
Argument N means do this N times (or till program stops for another reason)."));
add_com_alias ("ni", "nexti", class_alias, 0);
add_com ("finish", class_run, finish_command, _("\
Execute until selected stack frame returns.\n\
Upon return, the value returned is printed and put in the value history."));
add_com_alias ("fin", "finish", class_run, 1);
add_com ("next", class_run, next_command, _("\
Step program, proceeding through subroutine calls.\n\
Like the \"step\" command as long as subroutine calls do not happen;\n\
when they do, the call is treated as one instruction.\n\
Argument N means do this N times (or till program stops for another reason)."));
add_com_alias ("n", "next", class_run, 1);
if (xdb_commands)
1999-07-07 22:19:36 +02:00
add_com_alias ("S", "next", class_run, 1);
add_com ("step", class_run, step_command, _("\
Step program until it reaches a different source line.\n\
Argument N means do this N times (or till program stops for another reason)."));
add_com_alias ("s", "step", class_run, 1);
c = add_com ("until", class_run, until_command, _("\
Execute until the program reaches a source line greater than the current\n\
or a specified location (same args as break command) within the current frame."));
set_cmd_completer (c, location_completer);
add_com_alias ("u", "until", class_run, 1);
1999-07-07 22:19:36 +02:00
c = add_com ("advance", class_run, advance_command, _("\
Continue the program up to the given location (same form as args for break command).\n\
Execution will also stop upon exit from the current stack frame."));
set_cmd_completer (c, location_completer);
c = add_com ("jump", class_run, jump_command, _("\
Continue program being debugged at specified line or address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
for an address to start at."));
set_cmd_completer (c, location_completer);
1999-05-05 16:45:51 +02:00
if (xdb_commands)
* completer.c (gdb_completer_loc_break_characters): New variable. (line_completion_function): If we are completing on locations, back up the start of word pointer past all characters which can appear in a location spec. (location_completer): New function. * completer.h: Add prototype for location_completer. * symtab.c (make_source_files_completion_list) (add_filename_to_list, not_interesting_fname): New functions. (filename_seen): New function, body extracted from output_source_filename. (output_source_filename): Call filename_seen to check if the file was already printed. (make_symbol_completion_list): If TEXT includes a double-quoted string, return an empty list, not NULL. (make_file_symbol_completion_list): New function, similar to make_symbol_completion_list but with an additional argument SRCFILE. * symtab.h (make_file_symbol_completion_list) (make_source_files_completion_list): Add prototypes. * breakpoint.c (_initialize_breakpoint): Make location_completer be the completion function for all commands which set breakpoints and watchpoints. (top-level): #include "completer.h". * tracepoint.c (_initialize_tracepoint): Make location_completer be the completion function for the "trace" command. (top-level): #include "completer.h". * printcmd.c (_initialize_printcmd): Make location_completer be the completion function for the "print", "inspect", "call", and "disassemble" commands. (top-level): #include "completer.h". * infcmd.c (_initialize_infcmd): Make location_completer be the completion function for the "go", "jump", and "until" commands. (top-level): #include "completer.h".
2001-06-11 18:05:25 +02:00
{
c = add_com ("go", class_run, go_command, _("\
Usage: go <location>\n\
Continue program being debugged, stopping at specified line or \n\
address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an \n\
expression for an address to start at.\n\
This command is a combination of tbreak and jump."));
set_cmd_completer (c, location_completer);
* completer.c (gdb_completer_loc_break_characters): New variable. (line_completion_function): If we are completing on locations, back up the start of word pointer past all characters which can appear in a location spec. (location_completer): New function. * completer.h: Add prototype for location_completer. * symtab.c (make_source_files_completion_list) (add_filename_to_list, not_interesting_fname): New functions. (filename_seen): New function, body extracted from output_source_filename. (output_source_filename): Call filename_seen to check if the file was already printed. (make_symbol_completion_list): If TEXT includes a double-quoted string, return an empty list, not NULL. (make_file_symbol_completion_list): New function, similar to make_symbol_completion_list but with an additional argument SRCFILE. * symtab.h (make_file_symbol_completion_list) (make_source_files_completion_list): Add prototypes. * breakpoint.c (_initialize_breakpoint): Make location_completer be the completion function for all commands which set breakpoints and watchpoints. (top-level): #include "completer.h". * tracepoint.c (_initialize_tracepoint): Make location_completer be the completion function for the "trace" command. (top-level): #include "completer.h". * printcmd.c (_initialize_printcmd): Make location_completer be the completion function for the "print", "inspect", "call", and "disassemble" commands. (top-level): #include "completer.h". * infcmd.c (_initialize_infcmd): Make location_completer be the completion function for the "go", "jump", and "until" commands. (top-level): #include "completer.h".
2001-06-11 18:05:25 +02:00
}
1999-05-05 16:45:51 +02:00
if (xdb_commands)
1999-07-07 22:19:36 +02:00
add_com_alias ("g", "go", class_run, 1);
c = add_com ("continue", class_run, continue_command, _("\
Continue program being debugged, after signal or breakpoint.\n\
If proceeding from breakpoint, a number N may be used as an argument,\n\
which means to set the ignore count of that breakpoint to N - 1 (so that\n\
the breakpoint won't break until the Nth time it is reached).\n\
\n\
If non-stop mode is enabled, continue only the current thread,\n\
otherwise all the threads in the program are continued. To \n\
continue all stopped threads in non-stop mode, use the -a option.\n\
Specifying -a and an ignore count simultaneously is an error."));
add_com_alias ("c", "cont", class_run, 1);
add_com_alias ("fg", "cont", class_run, 1);
c = add_com ("run", class_run, run_command, _("\
Start debugged program. You may specify arguments to give it.\n\
Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
To cancel previous arguments and run with no arguments,\n\
use \"set args\" without arguments."));
set_cmd_completer (c, filename_completer);
add_com_alias ("r", "run", class_run, 1);
if (xdb_commands)
add_com ("R", class_run, run_no_args_command,
_("Start debugged program with no arguments."));
c = add_com ("start", class_run, start_command, _("\
Run the debugged program until the beginning of the main procedure.\n\
You may specify arguments to give to your program, just as with the\n\
\"run\" command."));
set_cmd_completer (c, filename_completer);
c = add_com ("interrupt", class_run, interrupt_target_command,
_("Interrupt the execution of the debugged program.\n\
If non-stop mode is enabled, interrupt only the current thread,\n\
otherwise all the threads in the program are stopped. To \n\
interrupt all running threads in non-stop mode, use the -a option."));
1999-07-05 19:58:44 +02:00
add_info ("registers", nofp_registers_info, _("\
List of integer registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
add_info_alias ("r", "registers", 1);
if (xdb_commands)
add_com ("lr", class_info, nofp_registers_info, _("\
List of integer registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
add_info ("all-registers", all_registers_info, _("\
List of all registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
add_info ("program", program_info,
_("Execution status of the program."));
add_info ("float", float_info,
_("Print the status of the floating point unit\n"));
add_info ("vector", vector_info,
_("Print the status of the vector unit\n"));
}