binutils-gdb/gdb/cli/cli-cmds.c

1678 lines
46 KiB
C
Raw Normal View History

2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* GDB CLI commands.
2002-01-17 23:15:18 +01:00
2011-01-01 16:34:07 +01:00
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
2011 Free Software Foundation, Inc.
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
This file is part of GDB.
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
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
(at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
#include "defs.h"
#include "exceptions.h"
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
#include "arch-utils.h"
#include "readline/readline.h"
#include "readline/tilde.h"
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout. */
#include "gdb_wait.h" /* For shell escape implementation. */
#include "gdb_regex.h" /* Used by apropos_command. */
#include "gdb_string.h"
#include "gdb_vfork.h"
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
#include "linespec.h"
#include "expression.h"
#include "frame.h"
#include "value.h"
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
#include "language.h"
#include "filenames.h" /* For DOSish file names. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
#include "objfiles.h"
#include "source.h"
#include "disasm.h"
#include "tracepoint.h"
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
#include "ui-out.h"
#include "top.h"
#include "cli/cli-decode.h"
#include "cli/cli-script.h"
#include "cli/cli-setshow.h"
#include "cli/cli-cmds.h"
#include "python/python.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
#endif
#include <fcntl.h>
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Prototypes for local command functions */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
static void complete_command (char *, int);
static void echo_command (char *, int);
static void pwd_command (char *, int);
static void show_version (char *, int);
static void help_command (char *, int);
static void show_command (char *, int);
static void info_command (char *, int);
static void show_debug (char *, int);
static void set_debug (char *, int);
static void show_user (char *, int);
static void make_command (char *, int);
static void shell_escape (char *, int);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
static void edit_command (char *, int);
static void list_command (char *, int);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
void apropos_command (char *, int);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Prototypes for local utility functions */
static void ambiguous_line_spec (struct symtabs_and_lines *);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Limit the call depth of user-defined commands */
int max_user_call_depth;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Define all cmd_list_elements. */
/* Chain containing all defined commands. */
struct cmd_list_element *cmdlist;
/* Chain containing all defined info subcommands. */
struct cmd_list_element *infolist;
/* Chain containing all defined enable subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *enablelist;
/* Chain containing all defined disable subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *disablelist;
/* Chain containing all defined toggle subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *togglelist;
/* Chain containing all defined stop subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *stoplist;
/* Chain containing all defined delete subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *deletelist;
/* Chain containing all defined detach subcommands. */
struct cmd_list_element *detachlist;
/* Chain containing all defined kill subcommands. */
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
struct cmd_list_element *killlist;
/* Chain containing all defined "enable breakpoint" subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *enablebreaklist;
/* Chain containing all defined set subcommands */
struct cmd_list_element *setlist;
/* Chain containing all defined unset subcommands */
struct cmd_list_element *unsetlist;
/* Chain containing all defined show subcommands. */
struct cmd_list_element *showlist;
/* Chain containing all defined \"set history\". */
struct cmd_list_element *sethistlist;
/* Chain containing all defined \"show history\". */
struct cmd_list_element *showhistlist;
/* Chain containing all defined \"unset history\". */
struct cmd_list_element *unsethistlist;
/* Chain containing all defined maintenance subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *maintenancelist;
/* Chain containing all defined "maintenance info" subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *maintenanceinfolist;
/* Chain containing all defined "maintenance print" subcommands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
struct cmd_list_element *maintenanceprintlist;
struct cmd_list_element *setprintlist;
struct cmd_list_element *showprintlist;
struct cmd_list_element *setdebuglist;
struct cmd_list_element *showdebuglist;
struct cmd_list_element *setchecklist;
struct cmd_list_element *showchecklist;
2006-07-21 16:46:56 +02:00
/* Command tracing state. */
int source_verbose = 0;
int trace_commands = 0;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* 'script-extension' option support. */
static const char script_ext_off[] = "off";
static const char script_ext_soft[] = "soft";
static const char script_ext_strict[] = "strict";
static const char *script_ext_enums[] = {
script_ext_off,
script_ext_soft,
script_ext_strict,
NULL
};
static const char *script_ext_mode = script_ext_soft;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Utility used everywhere when at least one argument is needed and
none is supplied. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
void
error_no_arg (char *why)
{
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 (_("Argument required (%s)."), why);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
/* The "info" command is defined as a prefix, with allow_unknown = 0.
Therefore, its own definition is called only for "info" with no
args. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
static void
info_command (char *arg, int from_tty)
{
printf_unfiltered (_("\"info\" must be followed by "
"the name of an info command.\n"));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
help_list (infolist, "info ", -1, gdb_stdout);
}
/* The "show" command with no arguments shows all the settings. */
static void
show_command (char *arg, int from_tty)
{
cmd_show_list (showlist, from_tty, "");
}
/* Provide documentation on command or list given by COMMAND. FROM_TTY
is ignored. */
static void
help_command (char *command, int from_tty)
{
help_cmd (command, gdb_stdout);
}
/* String compare function for qsort. */
static int
compare_strings (const void *arg1, const void *arg2)
{
const char **s1 = (const char **) arg1;
const char **s2 = (const char **) arg2;
return strcmp (*s1, *s2);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* The "complete" command is used by Emacs to implement completion. */
static void
complete_command (char *arg, int from_tty)
{
int argpoint;
char **completions, *point, *arg_prefix;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
dont_repeat ();
if (arg == NULL)
arg = "";
argpoint = strlen (arg);
/* complete_line assumes that its first argument is somewhere
within, and except for filenames at the beginning of, the word to
be completed. The following crude imitation of readline's
word-breaking tries to accomodate this. */
point = arg + argpoint;
while (point > arg)
{
if (strchr (rl_completer_word_break_characters, point[-1]) != 0)
break;
point--;
}
arg_prefix = alloca (point - arg + 1);
memcpy (arg_prefix, arg, point - arg);
arg_prefix[point - arg] = 0;
completions = complete_line (point, arg, argpoint);
if (completions)
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
int item, size;
for (size = 0; completions[size]; ++size)
;
qsort (completions, size, sizeof (char *), compare_strings);
/* We do extra processing here since we only want to print each
unique item once. */
item = 0;
while (item < size)
{
int next_item;
printf_unfiltered ("%s%s\n", arg_prefix, completions[item]);
next_item = item + 1;
while (next_item < size
&& ! strcmp (completions[item], completions[next_item]))
{
xfree (completions[next_item]);
++next_item;
}
xfree (completions[item]);
item = next_item;
}
xfree (completions);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
}
int
is_complete_command (struct cmd_list_element *c)
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
return cmd_cfunc_eq (c, complete_command);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
static void
show_version (char *args, int from_tty)
{
immediate_quit++;
print_gdb_version (gdb_stdout);
printf_filtered ("\n");
immediate_quit--;
}
/* Handle the quit command. */
void
quit_command (char *args, int from_tty)
{
if (!quit_confirm ())
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."));
2010-01-06 21:31:28 +01:00
disconnect_tracing (from_tty);
2010-01-06 21:31:28 +01:00
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
quit_force (args, from_tty);
}
static void
pwd_command (char *args, int from_tty)
{
if (args)
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 \"pwd\" command does not take an argument: %s"), args);
if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
error (_("Error finding name of working directory: %s"),
safe_strerror (errno));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
2003-11-07 Andrew Cagney <cagney@redhat.com> * top.c (print_gdb_version): Replace STREQ with strcmp. * valops.c (value_struct_elt_for_reference): Ditto. (value_struct_elt_for_reference): Ditto. * symtab.c (gdb_mangle_name): Ditto. (find_line_symtab): Ditto. * symmisc.c (maintenance_print_symbols): Ditto. * symfile.c (symbol_file_command): Ditto. * stabsread.c (define_symbol, read_type): Ditto. (cleanup_undefined_types, scan_file_globals): Ditto. * solib.c (solib_map_sections): Ditto. * solib-svr4.c (bfd_lookup_symbol): Ditto. * rs6000-tdep.c (skip_prologue): Ditto. * p-valprint.c (pascal_value_print): Ditto. (pascal_object_is_vtbl_ptr_type): Ditto. * objfiles.c (in_plt_section): Ditto. * minsyms.c (lookup_minimal_symbol): Ditto. (compact_minimal_symbols): Ditto. (find_solib_trampoline_target): Ditto. * mdebugread.c (parse_type): Ditto. * language.c (set_language_command): Ditto. (set_type_command, set_range_command): Ditto. * f-lang.c (add_common_block): Ditto. (add_common_block): Ditto. (find_first_common_named): Ditto. (patch_all_commons_by_name): Ditto. * elfread.c (elf_locate_sections): Ditto. (elf_locate_sections): Ditto. (elfstab_offset_sections): Ditto. * dwarf2read.c (dwarf2_locate_sections): Ditto. * dbxread.c (add_old_header_file): Ditto. (find_corresponding_bincl_psymtab): Ditto. (read_dbx_symtab, process_one_symbol): Ditto. * coffread.c (patch_opaque_types): Ditto. * cli/cli-decode.c (delete_cmd): Ditto. * cli/cli-cmds.c (pwd_command, list_command): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * breakpoint.c (bpstat_stop_status): Ditto. (clear_command, breakpoint_re_set_one): Ditto.
2003-11-08 01:13:03 +01:00
if (strcmp (gdb_dirbuf, current_directory) != 0)
printf_unfiltered (_("Working directory %s\n (canonically %s).\n"),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
current_directory, gdb_dirbuf);
else
printf_unfiltered (_("Working directory %s.\n"), current_directory);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
void
cd_command (char *dir, int from_tty)
{
int len;
/* Found something other than leading repetitions of "/..". */
int found_real_path;
char *p;
/* If the new directory is absolute, repeat is a no-op; if relative,
repeat might be useful but is more likely to be a mistake. */
dont_repeat ();
if (dir == 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 (_("new working directory"));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
dir = tilde_expand (dir);
2000-12-15 02:01:51 +01:00
make_cleanup (xfree, dir);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (chdir (dir) < 0)
perror_with_name (dir);
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* There's too much mess with DOSish names like "d:", "d:.",
"d:./foo" etc. Instead of having lots of special #ifdef'ed code,
simply get the canonicalized name of the current directory. */
dir = getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
#endif
len = strlen (dir);
if (IS_DIR_SEPARATOR (dir[len - 1]))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
/* Remove the trailing slash unless this is a root directory
(including a drive letter on non-Unix systems). */
if (!(len == 1) /* "/" */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
&& !(len == 3 && dir[1] == ':') /* "d:/" */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
#endif
)
len--;
}
dir = savestring (dir, len);
if (IS_ABSOLUTE_PATH (dir))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
current_directory = dir;
else
{
if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]))
current_directory = concat (current_directory, dir, (char *)NULL);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
else
current_directory = concat (current_directory, SLASH_STRING,
dir, (char *)NULL);
2000-12-15 02:01:51 +01:00
xfree (dir);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
/* Now simplify any occurrences of `.' and `..' in the pathname. */
found_real_path = 0;
for (p = current_directory; *p;)
{
if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.'
&& (p[2] == 0 || IS_DIR_SEPARATOR (p[2])))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
strcpy (p, p + 2);
else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.'
&& (p[3] == 0 || IS_DIR_SEPARATOR (p[3])))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
if (found_real_path)
{
/* Search backwards for the directory just before the "/.."
and obliterate it and the "/..". */
char *q = p;
while (q != current_directory && !IS_DIR_SEPARATOR (q[-1]))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
--q;
if (q == current_directory)
/* current_directory is
a relative pathname ("can't happen"--leave it alone). */
++p;
else
{
strcpy (q - 1, p + 3);
p = q - 1;
}
}
else
/* We are dealing with leading repetitions of "/..", for
example "/../..", which is the Mach super-root. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
p += 3;
}
else
{
found_real_path = 1;
++p;
}
}
forget_cached_source_info ();
if (from_tty)
pwd_command ((char *) 0, 1);
}
/* Show the current value of the 'script-extension' option. */
static void
show_script_ext_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
fprintf_filtered (file,
_("Script filename extension recognition is \"%s\".\n"),
value);
}
/* Try to open SCRIPT_FILE.
If successful, the full path name is stored in *FULL_PATHP,
the stream is stored in *STREAMP, and return 1.
The caller is responsible for freeing *FULL_PATHP.
If not successful, return 0; errno is set for the last file
we tried to open.
If SEARCH_PATH is non-zero, and the file isn't found in cwd,
search for it in the source search path.
NOTE: This calls openp which uses xfullpath to compute the full path
instead of gdb_realpath. Symbolic links are not resolved. */
int
find_and_open_script (const char *script_file, int search_path,
FILE **streamp, char **full_pathp)
{
char *file;
int fd;
struct cleanup *old_cleanups;
int search_flags = OPF_TRY_CWD_FIRST;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
file = tilde_expand (script_file);
2000-12-15 02:01:51 +01:00
old_cleanups = make_cleanup (xfree, file);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (search_path)
search_flags |= OPF_SEARCH_IN_PATH;
/* Search for and open 'file' on the search path used for source
files. Put the full location in *FULL_PATHP. */
fd = openp (source_path, search_flags,
file, O_RDONLY, full_pathp);
if (fd == -1)
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
int save_errno = errno;
do_cleanups (old_cleanups);
errno = save_errno;
return 0;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
do_cleanups (old_cleanups);
*streamp = fdopen (fd, FOPEN_RT);
return 1;
}
/* Load script FILE, which has already been opened as STREAM.
STREAM is closed before we return. */
static void
source_script_from_stream (FILE *stream, const char *file)
{
if (script_ext_mode != script_ext_off
&& strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py"))
{
volatile struct gdb_exception e;
TRY_CATCH (e, RETURN_MASK_ERROR)
{
source_python_script (stream, file);
}
if (e.reason < 0)
{
/* Should we fallback to ye olde GDB script mode? */
if (script_ext_mode == script_ext_soft
&& e.reason == RETURN_ERROR && e.error == UNSUPPORTED_ERROR)
{
fseek (stream, 0, SEEK_SET);
script_from_file (stream, (char*) file);
}
else
{
/* Nope, just punt. */
fclose (stream);
throw_exception (e);
}
}
else
fclose (stream);
}
else
script_from_file (stream, file);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Worker to perform the "source" command.
Load script FILE.
If SEARCH_PATH is non-zero, and the file isn't found in cwd,
search for it in the source search path. */
static void
source_script_with_search (const char *file, int from_tty, int search_path)
{
FILE *stream;
char *full_path;
struct cleanup *old_cleanups;
if (file == NULL || *file == 0)
error (_("source command requires file name of file to source."));
if (!find_and_open_script (file, search_path, &stream, &full_path))
{
/* The script wasn't found, or was otherwise inaccessible.
If the source command was invoked interactively, throw an
error. Otherwise (e.g. if it was invoked by a script),
silently ignore the error. */
if (from_tty)
perror_with_name (file);
else
return;
}
old_cleanups = make_cleanup (xfree, full_path);
source_script_from_stream (stream, file);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
do_cleanups (old_cleanups);
}
/* Wrapper around source_script_with_search to export it to main.c
for use in loading .gdbinit scripts. */
void
source_script (char *file, int from_tty)
{
source_script_with_search (file, from_tty, 0);
}
2006-07-21 16:46:56 +02:00
/* Return the source_verbose global variable to its previous state
on exit from the source command, by whatever means. */
static void
source_verbose_cleanup (void *old_value)
{
source_verbose = *(int *)old_value;
xfree (old_value);
}
static void
source_command (char *args, int from_tty)
{
struct cleanup *old_cleanups;
char *file = args;
int *old_source_verbose = xmalloc (sizeof(int));
int search_path = 0;
2006-07-21 16:46:56 +02:00
*old_source_verbose = source_verbose;
old_cleanups = make_cleanup (source_verbose_cleanup,
old_source_verbose);
2006-07-21 16:46:56 +02:00
/* -v causes the source command to run in verbose mode.
-s causes the file to be searched in the source search path,
even if the file name contains a '/'.
2006-07-21 16:46:56 +02:00
We still have to be able to handle filenames with spaces in a
backward compatible way, so buildargv is not appropriate. */
if (args)
{
while (args[0] != '\0')
2006-07-21 16:46:56 +02:00
{
/* Make sure leading white space does not break the
comparisons. */
while (isspace(args[0]))
args++;
if (args[0] != '-')
break;
if (args[1] == 'v' && isspace (args[2]))
{
source_verbose = 1;
/* Skip passed -v. */
args = &args[3];
}
else if (args[1] == 's' && isspace (args[2]))
{
search_path = 1;
2006-07-21 16:46:56 +02:00
/* Skip passed -s. */
args = &args[3];
}
else
break;
2006-07-21 16:46:56 +02:00
}
while (isspace (args[0]))
args++;
file = args;
2006-07-21 16:46:56 +02:00
}
source_script_with_search (file, from_tty, search_path);
do_cleanups (old_cleanups);
2006-07-21 16:46:56 +02:00
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
static void
echo_command (char *text, int from_tty)
{
char *p = text;
int c;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (text)
while ((c = *p++) != '\0')
{
if (c == '\\')
{
/* \ at end of argument is used after spaces
so they won't be lost. */
if (*p == 0)
return;
gdb 2010-03-05 Corinna Vinschen <vinschen@redhat.com> Tom Tromey <tromey@redhat.com> * utils.c (host_char_to_target): Add 'gdbarch' argument. (parse_escape): Likewise. * python/py-utils.c (unicode_to_target_string): Update. (unicode_to_target_python_string): Update. (target_string_to_unicode): Update. * printcmd.c (printf_command): Update. * p-exp.y (yylex): Update. * objc-exp.y (yylex): Update. * mi/mi-parse.c: Include charset.h. (mi_parse_escape): New function. (mi_parse_argv): Use it. * jv-exp.y (yylex): Update. * i386-cygwin-tdep.c (i386_cygwin_auto_wide_charset): New function. (i386_cygwin_init_abi): Call set_gdbarch_auto_wide_charset. * gdbarch.sh (auto_charset, auto_wide_charset): New. * gdbarch.c: Rebuild. * gdbarch.h: Rebuild. * defs.h (parse_escape): Update. * cli/cli-setshow.c: Include arch-utils.h. (do_setshow_command): Update. * cli/cli-cmds.c (echo_command): Update. * charset.h (target_charset, target_wide_charset): Update. * charset.c: Include arch-utils.h. (target_charset_name): Default to "auto". (target_wide_charset_name): Likewise. (show_target_charset_name): Handle "auto". (show_target_wide_charset_name): Likewise. (be_le_arch): New global. (set_be_le_names): Add 'gdbarch' argument. (validate): Likewise. Don't call set_be_le_names. (set_charset_sfunc, set_host_charset_sfunc) (set_target_charset_sfunc, set_target_wide_charset_sfunc): Update. (target_charset): Add 'gdbarch' argument. (target_wide_charset): Likewise. Remove 'byte_order' argument. (auto_target_charset_name): New global. (default_auto_charset, default_auto_wide_charset): New functions. (_initialize_charset): Set auto_target_charset_name. Allow "auto" for target charsets. Copy result of nl_langinfo. Use GetACP if USE_WIN32API. * c-lang.c (charset_for_string_type): Add 'gdbarch' argument, remove 'byte_order' argument. Update. (classify_type): Likewise. (c_emit_char): Update. (c_printchar): Update. (c_printstr): Update. (c_get_string): Update. (evaluate_subexp_c): Update. * arch-utils.h (default_auto_charset, default_auto_wide_charset): Declare. * python/python.c (gdbpy_target_charset): New function. (gdbpy_target_wide_charset): Likewise. (GdbMethods): Update. * NEWS: Update. gdb/doc * gdb.texinfo (Basic Python): Document target_charset and target_wide_charset. gdb/testsuite * gdb.python/py-prettyprint.py (pp_nullstr.to_string): Use gdb.target_charset. (pp_ns.to_string): Likewise.
2010-03-05 21:18:19 +01:00
c = parse_escape (get_current_arch (), &p);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (c >= 0)
printf_filtered ("%c", c);
}
else
printf_filtered ("%c", c);
}
/* Force this output to appear now. */
wrap_here ("");
gdb_flush (gdb_stdout);
}
static void
shell_escape (char *arg, int from_tty)
{
#if defined(CANT_FORK) || \
(!defined(HAVE_WORKING_VFORK) && !defined(HAVE_WORKING_FORK))
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* If ARG is NULL, they want an inferior shell, but `system' just
reports if the shell is available when passed a NULL arg. */
int rc = system (arg ? arg : "");
if (!arg)
arg = "inferior shell";
if (rc == -1)
{
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", arg,
safe_strerror (errno));
gdb_flush (gdb_stderr);
}
else if (rc)
{
fprintf_unfiltered (gdb_stderr, "%s exited with status %d\n", arg, rc);
gdb_flush (gdb_stderr);
}
#ifdef GLOBAL_CURDIR
/* Make sure to return to the directory GDB thinks it is, in case
the shell command we just ran changed it. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
chdir (current_directory);
#endif
#else /* Can fork. */
int status, pid;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if ((pid = vfork ()) == 0)
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
{
const char *p, *user_shell;
if ((user_shell = (char *) getenv ("SHELL")) == NULL)
user_shell = "/bin/sh";
/* Get the name of the shell for arg0. */
p = lbasename (user_shell);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (!arg)
execl (user_shell, p, (char *) 0);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
else
execl (user_shell, p, "-c", arg, (char *) 0);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell,
safe_strerror (errno));
gdb_flush (gdb_stderr);
_exit (0177);
}
if (pid != -1)
waitpid (pid, &status, 0);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
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 (_("Fork failed"));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
#endif /* Can fork. */
}
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
static void
edit_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct symbol *sym;
char *arg1;
char *editor;
char *p, *fn;
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Pull in the current default source line if necessary. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (arg == 0)
{
set_default_source_symtab_and_line ();
sal = get_current_source_symtab_and_line ();
}
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Bare "edit" edits file with present line. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (arg == 0)
{
if (sal.symtab == 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 default source file yet."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
sal.line += get_lines_to_list () / 2;
}
else
{
/* Now should only be one argument -- decode it in SAL. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
arg1 = arg;
sals = decode_line_1 (&arg1, 0, 0, 0, 0);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (! sals.nelts)
{
/* C++ */
return;
}
if (sals.nelts > 1)
{
ambiguous_line_spec (&sals);
xfree (sals.sals);
return;
}
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
sal = sals.sals[0];
xfree (sals.sals);
if (*arg1)
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 (_("Junk at end of line specification."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* If line was specified by address, first print exactly which
line, and which file. In this case, sal.symtab == 0 means
address is outside of all known source files, not that user
failed to give a filename. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (*arg == '*')
{
* 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;
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (sal.symtab == 0)
/* FIXME-32x64--assumes sal.pc fits in long. */
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 for address %s."),
* language.c (local_hex_format_custom): Remove. (local_hex_string): Rename to hex_string, use C format, and move to utils.c (local_hex_string_custom): Rename to hex_string_custom and change interface. Now uses C format. Move to utils.c (local_octal_format_custom): Remove. (local_decimal_format_custom): Remove. (unknown_language_defn): Remove language-specific number formatting entries. (auto_language_defn): Ditto. (local_language_defn): Ditto. * language.h (struct language_format_info): Delete declaration. (struct language_defn): Remove language_format_info fields la_binary_format, la_octal_format, la_decimal_format, la_hex_format. (local_binary_format): Remove macro. (local_binary_format_prefix): Remove macro. (local_binary_format_specifier): Remove macro. (local_binary_format_suffix): Remove macro. (local_octal_format): Remove macro. (local_octal_format_prefix): Remove macro. (local_octal_format_specifier): Remove macro. (local_octal_format_suffix): Remove macro. (local_decimal_format): Remove macro. (local_decimal_format_prefix): Remove macro. (local_decimal_format_specifier): Remove macro. (local_decimal_format_suffix): Remove macro. (local_hex_format): Remove macro. (local_hex_format_prefix): Remove macro. (local_hex_format_specifier): Remove macro. (local_hex_format_suffix): Remove macro. (local_decimal_format_custom): Remove. (local_octal_format_custom): Remove. (local_hex_format_custom): Remove. (local_hex_string): Rename to hex_string and move to defs.h. (local_hex_string_custom): Rename to hex_string_custom, change interface, and move to defs.h. * utils.c: (int_string): New function. (hex_string): New function (from language.c). (hex_string_custom): New function (from language.c). (octal2str): New function. (decimal2str): Add width parameter. (paddr_u): Use new decimal2str interface. (paddr_d): Ditto. * defs.h (hex_string): Declare. (hex_string_custom): Declare. (int_string): Declare. * printcmd.c (print_scalar_formatted): Remove localized binary formatting. * valprint.c (print_longest): Use int_string. (print_floating): Use C hex format. (print_hex_chars): Ditto. (print_binary_chars): Remove language-specific formatting. (print_octal_chars): Use C octal format. (print_decimal_chars): Delocalize format. (print_decimal): Remove. * ada-lang.c (ada_language_defn): Remove language-specific number formatting entries. * p-lang.c (pascal_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * scm-lang.c (scm_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * memattr.c (mem_info_command): Use renamed hex_string_custom with new interface. * pa64solib.c (pa64_sharedlibrary_info_command): Ditto. * ui-out.c (ui_out_field_core_addr): Ditto. * breakpoint.c (breakpoint_adjustment_warning): Ditto. * exec.c (print_section_info): Ditto. * i387-tdep.c (print_i387_status_word): Ditto. (print_i387_control_word): Ditto. (i387_print_float_info): Ditto. * maint.c (maint_print_section_info): Ditto. * solib.c (info_sharedlibrary_command): Ditto. * somsolib.c (som_sharedlibrary_info_command): Ditto. * symtab.c (print_msymbol_info): Ditto. * tracepoint.c (tracepoints_info): Ditto. * solib-frv.c (lm_base): Ditto. (frv_current_sos): Ditto. (enable_break2): Ditto. (enable_break): Ditto. * dbxread.c (read_dbx_symtab): Use renamed hex_string. (process_one_symbol): Ditto. * infcmd.c (program_info): Ditto. * mdebugread.c (parse_partial_symbols): Ditto. * symfile.c (add_symbol_file_command): Ditto. * cli/cli-cmds.c (edit_command): Ditto. (list_command): Ditto. * infcall.c (call_function_by_hand): Ditto. * remote-vx.c (vx_run_files_info): Ditto. (vx_wait): Ditto. (vx_attach): Ditto. (vx_detach): Ditto. (vx_kill): Ditto. * aix-thread.c (pdc_symbol_addrs): Ditto. (pdc_read_regs): Ditto. (pdc_write_regs): Ditto. (pdc_read_data): Ditto. (pdc_write_data): Ditto. * d10v-tdep.c (display_trace): Ditto. * rs6000-nat.c (find_toc_address): Ditto. * aix-thread.c: Don't include language.h. * buildsym.c: Ditto. * dbxread.c: Ditto. * mdebugread.c: Ditto. * rs6000-nat.c: Ditto. * buildsym.c (make_blockvector): Use renamed hex_string.
2004-09-11 12:24:53 +02:00
hex_string ((unsigned long) sal.pc));
* 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
gdbarch = get_objfile_arch (sal.symtab->objfile);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
sym = find_pc_function (sal.pc);
if (sym)
* 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 ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc),
SYMBOL_PRINT_NAME (sym),
sal.symtab->filename, sal.line);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
else
* 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 ("%s is at %s:%d.\n",
paddress (gdbarch, sal.pc),
sal.symtab->filename, sal.line);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
}
/* If what was given does not imply a symtab, it must be an
undebuggable symbol which means no source code. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (sal.symtab == 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 line number known for %s."), arg);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
}
if ((editor = (char *) getenv ("EDITOR")) == NULL)
editor = "/bin/ex";
/* If we don't already know the full absolute file name of the
source file, find it now. */
if (!sal.symtab->fullname)
{
fn = symtab_to_fullname (sal.symtab);
if (!fn)
fn = "unknown";
}
else
fn = sal.symtab->fullname;
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Quote the file name, in case it has whitespace or other special
characters. */
p = xstrprintf ("%s +%d \"%s\"", editor, sal.line, fn);
shell_escape (p, from_tty);
xfree (p);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
}
static void
list_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals, sals_end;
struct symtab_and_line sal = { 0 };
struct symtab_and_line sal_end = { 0 };
struct symtab_and_line cursal = { 0 };
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
struct symbol *sym;
char *arg1;
int no_end = 1;
int dummy_end = 0;
int dummy_beg = 0;
int linenum_beg = 0;
char *p;
/* Pull in the current default source line if necessary. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (arg == 0 || arg[0] == '+' || arg[0] == '-')
{
set_default_source_symtab_and_line ();
cursal = get_current_source_symtab_and_line ();
}
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* "l" or "l +" lists next ten lines. */
2003-11-07 Andrew Cagney <cagney@redhat.com> * top.c (print_gdb_version): Replace STREQ with strcmp. * valops.c (value_struct_elt_for_reference): Ditto. (value_struct_elt_for_reference): Ditto. * symtab.c (gdb_mangle_name): Ditto. (find_line_symtab): Ditto. * symmisc.c (maintenance_print_symbols): Ditto. * symfile.c (symbol_file_command): Ditto. * stabsread.c (define_symbol, read_type): Ditto. (cleanup_undefined_types, scan_file_globals): Ditto. * solib.c (solib_map_sections): Ditto. * solib-svr4.c (bfd_lookup_symbol): Ditto. * rs6000-tdep.c (skip_prologue): Ditto. * p-valprint.c (pascal_value_print): Ditto. (pascal_object_is_vtbl_ptr_type): Ditto. * objfiles.c (in_plt_section): Ditto. * minsyms.c (lookup_minimal_symbol): Ditto. (compact_minimal_symbols): Ditto. (find_solib_trampoline_target): Ditto. * mdebugread.c (parse_type): Ditto. * language.c (set_language_command): Ditto. (set_type_command, set_range_command): Ditto. * f-lang.c (add_common_block): Ditto. (add_common_block): Ditto. (find_first_common_named): Ditto. (patch_all_commons_by_name): Ditto. * elfread.c (elf_locate_sections): Ditto. (elf_locate_sections): Ditto. (elfstab_offset_sections): Ditto. * dwarf2read.c (dwarf2_locate_sections): Ditto. * dbxread.c (add_old_header_file): Ditto. (find_corresponding_bincl_psymtab): Ditto. (read_dbx_symtab, process_one_symbol): Ditto. * coffread.c (patch_opaque_types): Ditto. * cli/cli-decode.c (delete_cmd): Ditto. * cli/cli-cmds.c (pwd_command, list_command): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * breakpoint.c (bpstat_stop_status): Ditto. (clear_command, breakpoint_re_set_one): Ditto.
2003-11-08 01:13:03 +01:00
if (arg == 0 || strcmp (arg, "+") == 0)
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
{
print_source_lines (cursal.symtab, cursal.line,
cursal.line + get_lines_to_list (), 0);
return;
}
/* "l -" lists previous ten lines, the ones before the ten just
listed. */
2003-11-07 Andrew Cagney <cagney@redhat.com> * top.c (print_gdb_version): Replace STREQ with strcmp. * valops.c (value_struct_elt_for_reference): Ditto. (value_struct_elt_for_reference): Ditto. * symtab.c (gdb_mangle_name): Ditto. (find_line_symtab): Ditto. * symmisc.c (maintenance_print_symbols): Ditto. * symfile.c (symbol_file_command): Ditto. * stabsread.c (define_symbol, read_type): Ditto. (cleanup_undefined_types, scan_file_globals): Ditto. * solib.c (solib_map_sections): Ditto. * solib-svr4.c (bfd_lookup_symbol): Ditto. * rs6000-tdep.c (skip_prologue): Ditto. * p-valprint.c (pascal_value_print): Ditto. (pascal_object_is_vtbl_ptr_type): Ditto. * objfiles.c (in_plt_section): Ditto. * minsyms.c (lookup_minimal_symbol): Ditto. (compact_minimal_symbols): Ditto. (find_solib_trampoline_target): Ditto. * mdebugread.c (parse_type): Ditto. * language.c (set_language_command): Ditto. (set_type_command, set_range_command): Ditto. * f-lang.c (add_common_block): Ditto. (add_common_block): Ditto. (find_first_common_named): Ditto. (patch_all_commons_by_name): Ditto. * elfread.c (elf_locate_sections): Ditto. (elf_locate_sections): Ditto. (elfstab_offset_sections): Ditto. * dwarf2read.c (dwarf2_locate_sections): Ditto. * dbxread.c (add_old_header_file): Ditto. (find_corresponding_bincl_psymtab): Ditto. (read_dbx_symtab, process_one_symbol): Ditto. * coffread.c (patch_opaque_types): Ditto. * cli/cli-decode.c (delete_cmd): Ditto. * cli/cli-cmds.c (pwd_command, list_command): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * breakpoint.c (bpstat_stop_status): Ditto. (clear_command, breakpoint_re_set_one): Ditto.
2003-11-08 01:13:03 +01:00
if (strcmp (arg, "-") == 0)
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
{
print_source_lines (cursal.symtab,
max (get_first_line_listed ()
- get_lines_to_list (), 1),
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
get_first_line_listed (), 0);
return;
}
/* Now if there is only one argument, decode it in SAL
and set NO_END.
If there are two arguments, decode them in SAL and SAL_END
and clear NO_END; however, if one of the arguments is blank,
set DUMMY_BEG or DUMMY_END to record that fact. */
if (!have_full_symbols () && !have_partial_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 is loaded. Use the \"file\" command."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
arg1 = arg;
if (*arg1 == ',')
dummy_beg = 1;
else
{
sals = decode_line_1 (&arg1, 0, 0, 0, 0);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (!sals.nelts)
return; /* C++ */
if (sals.nelts > 1)
{
ambiguous_line_spec (&sals);
xfree (sals.sals);
return;
}
sal = sals.sals[0];
xfree (sals.sals);
}
/* Record whether the BEG arg is all digits. */
for (p = arg; p != arg1 && *p >= '0' && *p <= '9'; p++);
linenum_beg = (p == arg1);
while (*arg1 == ' ' || *arg1 == '\t')
arg1++;
if (*arg1 == ',')
{
no_end = 0;
arg1++;
while (*arg1 == ' ' || *arg1 == '\t')
arg1++;
if (*arg1 == 0)
dummy_end = 1;
else
{
if (dummy_beg)
sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
else
sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (sals_end.nelts == 0)
return;
if (sals_end.nelts > 1)
{
ambiguous_line_spec (&sals_end);
xfree (sals_end.sals);
return;
}
sal_end = sals_end.sals[0];
xfree (sals_end.sals);
}
}
if (*arg1)
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 (_("Junk at end of line specification."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (!no_end && !dummy_beg && !dummy_end
&& sal.symtab != sal_end.symtab)
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 (_("Specified start and end are in different files."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (dummy_beg && dummy_end)
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 (_("Two empty args do not say what lines to list."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* If line was specified by address,
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
first print exactly which line, and which file.
In this case, sal.symtab == 0 means address is outside of all
known source files, not that user failed to give a filename. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (*arg == '*')
{
* 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;
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (sal.symtab == 0)
/* FIXME-32x64--assumes sal.pc fits in long. */
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 for address %s."),
* language.c (local_hex_format_custom): Remove. (local_hex_string): Rename to hex_string, use C format, and move to utils.c (local_hex_string_custom): Rename to hex_string_custom and change interface. Now uses C format. Move to utils.c (local_octal_format_custom): Remove. (local_decimal_format_custom): Remove. (unknown_language_defn): Remove language-specific number formatting entries. (auto_language_defn): Ditto. (local_language_defn): Ditto. * language.h (struct language_format_info): Delete declaration. (struct language_defn): Remove language_format_info fields la_binary_format, la_octal_format, la_decimal_format, la_hex_format. (local_binary_format): Remove macro. (local_binary_format_prefix): Remove macro. (local_binary_format_specifier): Remove macro. (local_binary_format_suffix): Remove macro. (local_octal_format): Remove macro. (local_octal_format_prefix): Remove macro. (local_octal_format_specifier): Remove macro. (local_octal_format_suffix): Remove macro. (local_decimal_format): Remove macro. (local_decimal_format_prefix): Remove macro. (local_decimal_format_specifier): Remove macro. (local_decimal_format_suffix): Remove macro. (local_hex_format): Remove macro. (local_hex_format_prefix): Remove macro. (local_hex_format_specifier): Remove macro. (local_hex_format_suffix): Remove macro. (local_decimal_format_custom): Remove. (local_octal_format_custom): Remove. (local_hex_format_custom): Remove. (local_hex_string): Rename to hex_string and move to defs.h. (local_hex_string_custom): Rename to hex_string_custom, change interface, and move to defs.h. * utils.c: (int_string): New function. (hex_string): New function (from language.c). (hex_string_custom): New function (from language.c). (octal2str): New function. (decimal2str): Add width parameter. (paddr_u): Use new decimal2str interface. (paddr_d): Ditto. * defs.h (hex_string): Declare. (hex_string_custom): Declare. (int_string): Declare. * printcmd.c (print_scalar_formatted): Remove localized binary formatting. * valprint.c (print_longest): Use int_string. (print_floating): Use C hex format. (print_hex_chars): Ditto. (print_binary_chars): Remove language-specific formatting. (print_octal_chars): Use C octal format. (print_decimal_chars): Delocalize format. (print_decimal): Remove. * ada-lang.c (ada_language_defn): Remove language-specific number formatting entries. * p-lang.c (pascal_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * scm-lang.c (scm_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * memattr.c (mem_info_command): Use renamed hex_string_custom with new interface. * pa64solib.c (pa64_sharedlibrary_info_command): Ditto. * ui-out.c (ui_out_field_core_addr): Ditto. * breakpoint.c (breakpoint_adjustment_warning): Ditto. * exec.c (print_section_info): Ditto. * i387-tdep.c (print_i387_status_word): Ditto. (print_i387_control_word): Ditto. (i387_print_float_info): Ditto. * maint.c (maint_print_section_info): Ditto. * solib.c (info_sharedlibrary_command): Ditto. * somsolib.c (som_sharedlibrary_info_command): Ditto. * symtab.c (print_msymbol_info): Ditto. * tracepoint.c (tracepoints_info): Ditto. * solib-frv.c (lm_base): Ditto. (frv_current_sos): Ditto. (enable_break2): Ditto. (enable_break): Ditto. * dbxread.c (read_dbx_symtab): Use renamed hex_string. (process_one_symbol): Ditto. * infcmd.c (program_info): Ditto. * mdebugread.c (parse_partial_symbols): Ditto. * symfile.c (add_symbol_file_command): Ditto. * cli/cli-cmds.c (edit_command): Ditto. (list_command): Ditto. * infcall.c (call_function_by_hand): Ditto. * remote-vx.c (vx_run_files_info): Ditto. (vx_wait): Ditto. (vx_attach): Ditto. (vx_detach): Ditto. (vx_kill): Ditto. * aix-thread.c (pdc_symbol_addrs): Ditto. (pdc_read_regs): Ditto. (pdc_write_regs): Ditto. (pdc_read_data): Ditto. (pdc_write_data): Ditto. * d10v-tdep.c (display_trace): Ditto. * rs6000-nat.c (find_toc_address): Ditto. * aix-thread.c: Don't include language.h. * buildsym.c: Ditto. * dbxread.c: Ditto. * mdebugread.c: Ditto. * rs6000-nat.c: Ditto. * buildsym.c (make_blockvector): Use renamed hex_string.
2004-09-11 12:24:53 +02:00
hex_string ((unsigned long) sal.pc));
* 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
gdbarch = get_objfile_arch (sal.symtab->objfile);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
sym = find_pc_function (sal.pc);
if (sym)
printf_filtered ("%s is in %s (%s:%d).\n",
* 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
paddress (gdbarch, sal.pc),
SYMBOL_PRINT_NAME (sym),
sal.symtab->filename, sal.line);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
else
* 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 ("%s is at %s:%d.\n",
paddress (gdbarch, sal.pc),
sal.symtab->filename, sal.line);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
}
/* If line was not specified by just a line number, and it does not
imply a symtab, it must be an undebuggable symbol which means no
source code. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (!linenum_beg && sal.symtab == 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 line number known for %s."), arg);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* If this command is repeated with RET,
turn it into the no-arg variant. */
if (from_tty)
*arg = 0;
if (dummy_beg && sal_end.symtab == 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 default source file yet. Do \"help list\"."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (dummy_beg)
print_source_lines (sal_end.symtab,
max (sal_end.line - (get_lines_to_list () - 1), 1),
sal_end.line + 1, 0);
else if (sal.symtab == 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 default source file yet. Do \"help list\"."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
else if (no_end)
{
int first_line = sal.line - get_lines_to_list () / 2;
if (first_line < 1) first_line = 1;
print_source_lines (sal.symtab,
first_line,
first_line + get_lines_to_list (),
0);
}
else
print_source_lines (sal.symtab, sal.line,
(dummy_end
? sal.line + get_lines_to_list ()
: sal_end.line + 1),
0);
}
/* Subroutine of disassemble_command to simplify it.
Perform the disassembly.
NAME is the name of the function if known, or NULL.
[LOW,HIGH) are the range of addresses to disassemble.
MIXED is non-zero to print source with the assembler. */
static void
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
print_disassembly (struct gdbarch *gdbarch, const char *name,
CORE_ADDR low, CORE_ADDR high, int flags)
{
#if defined(TUI)
if (!tui_is_window_visible (DISASSEM_WIN))
#endif
{
printf_filtered ("Dump of assembler code ");
if (name != NULL)
printf_filtered ("for function %s:\n", name);
else
* 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 ("from %s to %s:\n",
paddress (gdbarch, low), paddress (gdbarch, high));
/* Dump the specified range. */
gdb_disassembly (gdbarch, uiout, 0, flags, -1, low, high);
printf_filtered ("End of assembler dump.\n");
gdb_flush (gdb_stdout);
}
#if defined(TUI)
else
{
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
tui_show_assembly (gdbarch, low);
}
#endif
}
/* Subroutine of disassemble_command to simplify it.
Print a disassembly of the current function according to FLAGS. */
static void
disassemble_current_function (int flags)
{
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
struct frame_info *frame;
struct gdbarch *gdbarch;
CORE_ADDR low, high, pc;
char *name;
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
frame = get_selected_frame (_("No frame selected."));
gdbarch = get_frame_arch (frame);
pc = get_frame_pc (frame);
if (find_pc_partial_function (pc, &name, &low, &high) == 0)
error (_("No function contains program counter for selected frame."));
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
if (tui_active)
/* FIXME: cagney/2004-02-07: This should be an observer. */
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
low = tui_get_low_disassembly_address (gdbarch, low, pc);
#endif
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
low += gdbarch_deprecated_function_start_offset (gdbarch);
print_disassembly (gdbarch, name, low, high, flags);
}
/* Dump a specified section of assembly code.
Usage:
disassemble [/mr]
- dump the assembly code for the function of the current pc
disassemble [/mr] addr
- dump the assembly code for the function at ADDR
disassemble [/mr] low,high
disassemble [/mr] low,+length
- dump the assembly code in the range [LOW,HIGH), or [LOW,LOW+length)
A /m modifier will include source code with the assembly.
A /r modifier will include raw instructions in hex with the assembly. */
static void
disassemble_command (char *arg, int from_tty)
{
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR low, high;
char *name;
CORE_ADDR pc;
int flags;
name = NULL;
flags = 0;
if (arg && *arg == '/')
{
++arg;
if (*arg == '\0')
error (_("Missing modifier."));
while (*arg && ! isspace (*arg))
{
switch (*arg++)
{
case 'm':
flags |= DISASSEMBLY_SOURCE;
break;
case 'r':
flags |= DISASSEMBLY_RAW_INSN;
break;
default:
error (_("Invalid disassembly modifier."));
}
}
while (isspace (*arg))
++arg;
}
if (! arg || ! *arg)
{
flags |= DISASSEMBLY_OMIT_FNAME;
disassemble_current_function (flags);
return;
}
pc = value_as_address (parse_to_comma_and_eval (&arg));
if (arg[0] == ',')
++arg;
if (arg[0] == '\0')
{
/* One argument. */
if (find_pc_partial_function (pc, &name, &low, &high) == 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 function contains specified address."));
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
if (tui_active)
/* FIXME: cagney/2004-02-07: This should be an observer. */
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
low = tui_get_low_disassembly_address (gdbarch, low, pc);
#endif
* disasm.h (gdb_disassembly): Add GDBARCH parameter. (gdb_print_insn): Likewise. * disasm.c (dump_insns): Add GDBARCH parameter. Use it instead of current_gdbarch. (do_mixed_source_and_assembly): Add GDBARCH parameter. Pass to dump_insns. (do_assembly_only): Likewise. (gdb_disassembly): Add GDBARCH parameter. Use it instead of current_gdbarch. Pass to subroutines. (gdb_print_insn): Add GDBARCH parameter. Use it instead of current_gdbarch. * stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member. (gdb_disassembly_stub): Pass architecture to gdb_disassembly. (do_gdb_disassembly): Add GDBARCH argument. Store into args. (print_frame_info): Pass architecture to do_gdb_disassembly. * printcmd.c (print_formatted): Pass architecture to gdb_print_insn. * mi/mi-cmd-disas.c: Include "arch-utils.h" (mi_cmd_disassemble): Pass architecture to gdb_disassembly. * cli/cli-cmds.c: Include "arch-utils.h". (print_disassembly): Add GDBARCH parameter. Pass to gdb_disassembly and tui_show_assembly. (disassemble_current_function): Pass architecture to tui_get_low_disassembly_address and print_disassembly. (disassemble_command): Pass architecture to tui_get_low_disassembly_address and print_disassembly. * tui/tui.c (tui_show_assembly): Add GDBARCH parameter. Pass to tui_update_source_windows_with_addr. * tui/tui-data.h (struct tui_locator_element): Add GDBARCH member. (struct tui_source_info): Likewise. * tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch. * tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter. Pass to gdb_print_insn. (tui_find_disassembly_address): Add GDBARCH parameter. Pass to tui_disassemble. (tui_set_disassem_content): Add GDBARCH parameter. Install into source_info.gdbarch. Pass to tui_disassemble. (tui_show_disassem): Add GDBARCH parameter. Pass to tui_update_source_window. (tui_show_disassem_and_update_source): Add GDBARCH parameter. Pass to tui_show_disassem and tui_update_source_window. (tui_get_begin_asm_address): Return locator architecture in addition to locator PC value. (tui_get_low_disassembly_address): Add GDBARCH parameter. Pass to tui_get_low_disassembly_address. (tui_vertical_disassem_scroll): Pass architecture to subroutines. * tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter. (tui_show_disassem): Likewise. (tui_show_disassem_and_update_source): Likewise. (tui_get_begin_asm_address): Return architecture and PC value. * tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter. (tui_show_assembly): Add GDBARCH parameter. * tui/tui-layout.c (extract_display_start_addr): Return current window architecture in addition to current PC value. (tui_set_layout): Update calls to tui_get_low_disassembly_address and extract_display_start_addr. Pass architecture to tui_update_source_windows_with_addr. * tui/tui-source.c: Include "objfiles.h". (tui_set_source_content): Initialize window architecture. (tui_show_symtab_source): Add GDBARCH parameter. Pass to tui_update_source_window_as_is * tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter. * tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter. Install locator architecture. (tui_set_locator_filename): Update call. (tui_show_frame_info): Pass architecture to tui_set_locator_info and subroutines. * tui/tui-win.c (make_visible_with_new_height): Pass architecture to tui_update_source_window. * tui/tui-winsource.c: Include "objfiles.h". (tui_display_main): Update call to tui_get_begin_asm_address. Pass architecture to tui_update_source_windows_with_addr. (tui_update_source_window): Add GDBARCH parameter. Pass to tui_update_source_window_as_is. (tui_update_source_window_as_is): Add GDBARCH parameter. Pass to tui_set_disassem_content. (tui_update_source_windows_with_addr): Add GDBARCH parameter. Pass to subroutines. (tui_update_source_windows_with_line): Pass objfile architecture to subroutines. (tui_horizontal_source_scroll): Pass architecture to tui_update_source_window_as_is. * tui/tui-winsource.h (tui_update_source_window): Add GDBARCH parameter. (tui_update_source_window_as_is): Likewise. (tui_update_source_windows_with_addr): Likewise.
2009-07-02 19:17:42 +02:00
low += gdbarch_deprecated_function_start_offset (gdbarch);
flags |= DISASSEMBLY_OMIT_FNAME;
}
else
{
/* Two arguments. */
int incl_flag = 0;
low = pc;
while (isspace (*arg))
arg++;
if (arg[0] == '+')
{
++arg;
incl_flag = 1;
}
high = parse_and_eval_address (arg);
if (incl_flag)
high += low;
}
print_disassembly (gdbarch, name, low, high, flags);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
static void
make_command (char *arg, int from_tty)
{
char *p;
if (arg == 0)
p = "make";
else
{
p = xmalloc (sizeof ("make ") + strlen (arg));
strcpy (p, "make ");
strcpy (p + sizeof ("make ") - 1, arg);
}
shell_escape (p, from_tty);
}
static void
show_user (char *args, int from_tty)
{
struct cmd_list_element *c;
extern struct cmd_list_element *cmdlist;
if (args)
{
char *comname = args;
c = lookup_cmd (&comname, cmdlist, "", 0, 1);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (c->class != class_user)
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 a user command."));
show_user_1 (c, "", args, gdb_stdout);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
else
{
for (c = cmdlist; c; c = c->next)
{
if (c->class == class_user || c->prefixlist != NULL)
show_user_1 (c, "", c->name, gdb_stdout);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
}
}
/* Search through names of commands and documentations for a certain
regular expression. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
void
apropos_command (char *searchstr, int from_tty)
{
regex_t pattern;
int code;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (searchstr == NULL)
error (_("REGEXP string is empty"));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
code = regcomp (&pattern, searchstr, REG_ICASE);
if (code == 0)
{
struct cleanup *cleanups;
cleanups = make_regfree_cleanup (&pattern);
apropos_cmd (gdb_stdout, cmdlist, &pattern, "");
do_cleanups (cleanups);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
else
{
char *err = get_regcomp_error (code, &pattern);
make_cleanup (xfree, err);
error (_("Error in regular expression: %s"), err);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}
}
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
/* Print a list of files and line numbers which a user may choose from
in order to list a function which was specified ambiguously (as
with `list classname::overloadedfuncname', for example). The
vector in SALS provides the filenames and line numbers. */
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
static void
ambiguous_line_spec (struct symtabs_and_lines *sals)
{
int i;
for (i = 0; i < sals->nelts; ++i)
printf_filtered (_("file: \"%s\", line number: %d\n"),
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
sals->sals[i].symtab->filename, sals->sals[i].line);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
static void
set_debug (char *arg, int from_tty)
{
printf_unfiltered (_("\"set debug\" must be followed by "
"the name of a debug subcommand.\n"));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
help_list (setdebuglist, "set debug ", -1, gdb_stdout);
}
static void
show_debug (char *args, int from_tty)
{
cmd_show_list (showdebuglist, from_tty, "");
}
void
init_cmd_lists (void)
{
max_user_call_depth = 1024;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
cmdlist = NULL;
infolist = NULL;
enablelist = NULL;
disablelist = NULL;
togglelist = NULL;
stoplist = NULL;
deletelist = NULL;
detachlist = NULL;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
enablebreaklist = NULL;
setlist = NULL;
unsetlist = NULL;
showlist = NULL;
sethistlist = NULL;
showhistlist = NULL;
unsethistlist = NULL;
maintenancelist = NULL;
maintenanceinfolist = NULL;
maintenanceprintlist = NULL;
setprintlist = NULL;
showprintlist = NULL;
setchecklist = NULL;
showchecklist = NULL;
}
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
static void
show_info_verbose (struct ui_file *file, int from_tty,
struct cmd_list_element *c,
const char *value)
{
if (info_verbose)
fprintf_filtered (file,
_("Verbose printing of informational messages is %s.\n"),
value);
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
else
fprintf_filtered (file, _("Verbosity is %s.\n"), value);
}
static void
show_history_expansion_p (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file, _("History expansion on command input is %s.\n"),
value);
}
static void
show_baud_rate (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
value);
}
static void
show_remote_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file, _("Debugging of remote protocol is %s.\n"),
value);
}
static void
show_remote_timeout (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file,
_("Timeout limit to wait for target to respond is %s.\n"),
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
value);
}
static void
show_max_user_call_depth (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file,
_("The max call depth for user-defined commands is %s.\n"),
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
value);
}
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
void
init_cli_cmds (void)
{
struct cmd_list_element *c;
char *source_help_text;
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Define the classes of commands.
They will appear in the help list in the reverse of this order. */
add_cmd ("internals", class_maintenance, NULL, _("\
Maintenance commands.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
Some gdb commands are provided just for use by gdb maintainers.\n\
These commands are subject to frequent change, and may not be as\n\
well documented as user commands."),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&cmdlist);
add_cmd ("obscure", class_obscure, NULL, _("Obscure features."), &cmdlist);
add_cmd ("aliases", class_alias, NULL,
_("Aliases of other commands."), &cmdlist);
add_cmd ("user-defined", class_user, NULL, _("\
User-defined commands.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
The commands in this class are those defined by the user.\n\
Use the \"define\" command to define a command."), &cmdlist);
add_cmd ("support", class_support, NULL, _("Support facilities."), &cmdlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (!dbx_commands)
add_cmd ("status", class_info, NULL, _("Status inquiries."), &cmdlist);
add_cmd ("files", class_files, NULL, _("Specifying and examining files."),
&cmdlist);
add_cmd ("breakpoints", class_breakpoint, NULL,
_("Making program stop at certain points."), &cmdlist);
add_cmd ("data", class_vars, NULL, _("Examining data."), &cmdlist);
add_cmd ("stack", class_stack, NULL, _("\
Examining the stack.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
The stack is made up of stack frames. Gdb assigns numbers to stack frames\n\
counting from zero for the innermost (currently executing) frame.\n\n\
At any time gdb identifies one frame as the \"selected\" frame.\n\
Variable lookups are done with respect to the selected frame.\n\
When the program being debugged stops, gdb selects the innermost frame.\n\
The commands below can be used to select other frames by number or address."),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&cmdlist);
add_cmd ("running", class_run, NULL, _("Running the program."), &cmdlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Define general commands. */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
2009-03-25 22:42:35 +01:00
add_com ("pwd", class_files, pwd_command, _("\
Print working directory. This is used for your program as well."));
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
c = add_cmd ("cd", class_files, cd_command, _("\
Set working directory to DIR for debugger and program being debugged.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
The change does not take effect for the program being debugged\n\
until the next time it is started."), &cmdlist);
set_cmd_completer (c, filename_completer);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com ("echo", class_support, echo_command, _("\
Print a constant string. Give string as argument.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
C escape sequences may be used in the argument.\n\
No newline is added at the end of the argument;\n\
use \"\\n\" if you want a newline to be printed.\n\
Since leading and trailing whitespace are ignored in command arguments,\n\
if you want to print some you must use \"\\\" before leading whitespace\n\
to be printed or after trailing whitespace."));
add_com ("document", class_support, document_command, _("\
Document a user-defined command.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
Give command name as argument. Give documentation on following lines.\n\
End with a line of just \"end\"."));
add_com ("define", class_support, define_command, _("\
Define a new command name. Command name is argument.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
Definition appears on following lines, one command per line.\n\
End with a line of just \"end\".\n\
Use the \"document\" command to give documentation for the new command.\n\
Commands defined in this way may have up to ten arguments."));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
source_help_text = xstrprintf (_("\
Read commands from a file named FILE.\n\
\n\
Usage: source [-s] [-v] FILE\n\
-s: search for the script in the source search path,\n\
even if FILE contains directories.\n\
-v: each command in FILE is echoed as it is executed.\n\
\n\
Note that the file \"%s\" is read automatically in this way\n\
2006-07-21 16:46:56 +02:00
when GDB is started."), gdbinit);
c = add_cmd ("source", class_support, source_command,
source_help_text, &cmdlist);
set_cmd_completer (c, filename_completer);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_setshow_enum_cmd ("script-extension", class_support,
script_ext_enums, &script_ext_mode, _("\
Set mode for script filename extension recognition."), _("\
Show mode for script filename extension recognition."), _("\
off == no filename extension recognition (all sourced files are GDB scripts)\n\
soft == evaluate script according to filename extension, fallback to GDB script"
"\n\
strict == evaluate script according to filename extension, error if not supported"
),
NULL,
show_script_ext_mode,
&setlist, &showlist);
add_com ("quit", class_support, quit_command, _("Exit gdb."));
c = add_com ("help", class_support, help_command,
_("Print list of commands."));
set_cmd_completer (c, command_completer);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com_alias ("q", "quit", class_support, 1);
add_com_alias ("h", "help", class_support, 1);
add_setshow_boolean_cmd ("verbose", class_support, &info_verbose, _("\
Set verbosity."), _("\
Show verbosity."), NULL,
set_verbose,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_info_verbose,
&setlist, &showlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_prefix_cmd ("history", class_support, set_history,
_("Generic command for setting command history parameters."),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&sethistlist, "set history ", 0, &setlist);
add_prefix_cmd ("history", class_support, show_history,
_("Generic command for showing command history parameters."),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&showhistlist, "show history ", 0, &showlist);
add_setshow_boolean_cmd ("expansion", no_class, &history_expansion_p, _("\
Set history expansion on command input."), _("\
Show history expansion on command input."), _("\
Without an argument, history expansion is enabled."),
NULL,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_history_expansion_p,
&sethistlist, &showhistlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
2009-03-25 22:42:35 +01:00
add_prefix_cmd ("info", class_info, info_command, _("\
Generic command for showing things about the program being debugged."),
2009-03-25 22:42:35 +01:00
&infolist, "info ", 0, &cmdlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com_alias ("i", "info", class_info, 1);
add_com_alias ("inf", "info", class_info, 1);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com ("complete", class_obscure, complete_command,
_("List the completions for the rest of the line as a command."));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
2009-03-25 22:42:35 +01:00
add_prefix_cmd ("show", class_info, show_command, _("\
Generic command for showing things about the debugger."),
2009-03-25 22:42:35 +01:00
&showlist, "show ", 0, &cmdlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* Another way to get at the same thing. */
add_info ("set", show_command, _("Show all GDB settings."));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_cmd ("commands", no_set_class, show_commands, _("\
Show the history of commands you typed.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
You can supply a command number to start with, or a `+' to start after\n\
the previous command number shown."),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&showlist);
add_cmd ("version", no_set_class, show_version,
_("Show what version of GDB this is."), &showlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com ("while", class_support, while_command, _("\
Execute nested commands WHILE the conditional expression is non zero.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
The conditional expression must follow the word `while' and must in turn be\n\
followed by a new line. The nested commands must be entered one per line,\n\
and should be terminated by the word `end'."));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_com ("if", class_support, if_command, _("\
Execute nested commands once IF the conditional expression is non zero.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
The conditional expression must follow the word `if' and must in turn be\n\
followed by a new line. The nested commands must be entered one per line,\n\
and should be terminated by the word 'else' or `end'. If an else clause\n\
is used, the same rules apply to its nested commands as to the first ones."));
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* If target is open when baud changes, it doesn't take effect until
the next open (I think, not sure). */
add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
Set baud rate for remote serial I/O."), _("\
Show baud rate for remote serial I/O."), _("\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
This value is used to set the speed of the serial port when debugging\n\
using remote targets."),
NULL,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_baud_rate,
&setlist, &showlist);
add_setshow_zinteger_cmd ("remote", no_class, &remote_debug, _("\
Set debugging of remote protocol."), _("\
Show debugging of remote protocol."), _("\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
When enabled, each packet sent or received with the remote target\n\
is displayed."),
NULL,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_remote_debug,
&setdebuglist, &showdebuglist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_setshow_integer_cmd ("remotetimeout", no_class, &remote_timeout, _("\
Set timeout limit to wait for target to respond."), _("\
Show timeout limit to wait for target to respond."), _("\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
This value is used to set the time limit for gdb to wait for a response\n\
from the target."),
NULL,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_remote_timeout,
&setlist, &showlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
add_prefix_cmd ("debug", no_class, set_debug,
_("Generic command for setting gdb debugging flags"),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&setdebuglist, "set debug ", 0, &setlist);
add_prefix_cmd ("debug", no_class, show_debug,
_("Generic command for showing gdb debugging flags"),
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
&showdebuglist, "show debug ", 0, &showlist);
c = add_com ("shell", class_support, shell_escape, _("\
Execute the rest of the line as a shell command.\n\
With no arguments, run an inferior shell."));
set_cmd_completer (c, filename_completer);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
c = add_com ("edit", class_files, edit_command, _("\
Edit specified file or function.\n\
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
With no argument, edits file containing most recent line listed.\n\
Editing targets can be specified in these ways:\n\
FILE:LINENUM, to edit at that line in that file,\n\
FUNCTION, to edit at the beginning of that function,\n\
FILE:FUNCTION, to distinguish among like-named static functions.\n\
*ADDRESS, to edit at the line containing that address.\n\
Uses EDITOR environment variable contents as editor (or ex as default)."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
c->completer = location_completer;
add_com ("list", class_files, list_command, _("\
List specified function or line.\n\
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
With no argument, lists ten more lines after or around previous listing.\n\
\"list -\" lists the ten lines before a previous ten-line listing.\n\
One argument specifies a line, and ten lines are listed around that line.\n\
Two arguments with comma between specify starting and ending lines to list.\n\
Lines can be specified in these ways:\n\
LINENUM, to list around that line in current file,\n\
FILE:LINENUM, to list around that line in that file,\n\
FUNCTION, to list around beginning of that function,\n\
FILE:FUNCTION, to distinguish among like-named static functions.\n\
*ADDRESS, to list around the line containing that address.\n\
With two args if one is empty it stands for ten lines away from \
the other arg."));
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
if (!xdb_commands)
add_com_alias ("l", "list", class_files, 1);
else
add_com_alias ("v", "list", class_files, 1);
if (dbx_commands)
add_com_alias ("file", "list", class_files, 1);
c = add_com ("disassemble", class_vars, disassemble_command, _("\
Disassemble a specified section of memory.\n\
Default is the function surrounding the pc of the selected frame.\n\
With a /m modifier, source lines are included (if available).\n\
With a /r modifier, raw instructions in hex are included.\n\
With a single argument, the function surrounding that address is dumped.\n\
Two arguments (separated by a comma) are taken as a range of memory to dump,\n\
in the form of \"start,end\", or \"start,+length\"."));
set_cmd_completer (c, location_completer);
if (xdb_commands)
add_com_alias ("va", "disassemble", class_xdb, 0);
* source.c: Make global variables current_source_symtab and current_source_line static. (list_command): Moved to cli/cli-cmds.c. (ambiguous_line_spec): Moved to cli/cli-cmds.c. (get_first_line_listed): New accessor function. (get_lines_to_list): New accessor function. (get_current_source_symtab_and_line): New function. Retrieves the position in the source code that we consider current. (get_current_or_default_source_symtab_and_line): New function. Like the above but attempts to determine a default position if one is not currently defined. (set_current_source_symtab_and_line): New function. Sets the source code position considered current and returns the previously set one. (clear_current_source_symtab_and_line): Reset stored information about a current source line. (_initialize_source): Remove registration for the "list" command and its alias. * source.h: Add declarations for the new functions above. * symtab.h: Remove declarations for the global variables mentioned above. * breakpoint.c (parse_breakpoint_sals): Use accessor functions to obtain current source line. * linespec.c (decode_line_1): Ditto. * macroscope.c (default_macro_scope): Ditto. * scm-lang.c (scm_unpac): Ditto. * stack.c (print_frame_info_base): Ditto. * symfile.c (clear_symtab_users): Ditto. * symtab.c (decode_line_spec): Ditto. * cli/cli-cmds.c (list_command): Moved here from source.c. (ambiguous_line_spec): Moved here from source.c. (_init_cli_cmds): Add definition for "list" and its alias. * Makefile.in: Update dependencies.
2002-09-20 16:58:59 +02:00
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
/* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
be a really useful feature. Unfortunately, the below wont do
this. Instead it adds support for the form ``(gdb) ! ls''
(i.e. the space is required). If the ``!'' command below is
added the complains about no ``!'' command would be replaced by
complains about how the ``!'' command is broken :-) */
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
if (xdb_commands)
add_com_alias ("!", "shell", class_support, 0);
c = add_com ("make", class_support, make_command, _("\
Run the ``make'' program using the rest of the line as arguments."));
set_cmd_completer (c, filename_completer);
add_cmd ("user", no_class, show_user, _("\
Show definitions of user defined commands.\n\
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
Argument is the name of the user defined command.\n\
With no argument, show definitions of all user defined commands."), &showlist);
add_com ("apropos", class_support, apropos_command,
_("Search for commands matching a REGEXP"));
add_setshow_integer_cmd ("max-user-call-depth", no_class,
&max_user_call_depth, _("\
Set the max call depth for user-defined commands."), _("\
Show the max call depth for user-defined commands."), NULL,
NULL,
2005-02-24 Andrew Cagney <cagney@gnu.org> Add show_VARIABLE functions, update add_setshow call. * varobj.c (_initialize_varobj, show_varobjdebug): Add and update. * valprint.c (_initialize_valprint, show_print_max) (show_stop_print_at_null, show_repeat_count_threshold) (show_prettyprint_structs, show_unionprint) (show_prettyprint_arrays, show_addressprint, show_input_radix) (show_output_radix): Ditto. * valops.c (_initialize_valops, show_overload_resolution): Ditto. * utils.c (initialize_utils, show_chars_per_line) (show_lines_per_page, show_demangle, show_pagination_enabled) (show_sevenbit_strings, show_asm_demangle): Ditto * tui/tui-win.c (_initialize_tui_win, show_tui_border_kind) (show_tui_border_mode, show_tui_active_border_mode): Ditto. * top.c (init_main, show_new_async_prompt) (show_async_command_editing_p, show_write_history_p) (show_history_size, show_history_filename, show_caution) (show_annotation_level, init_main): Ditto. * target.c (initialize_targets, show_targetdebug) (show_trust_readonly): Ditto. * symfile.c (_initialize_symfile, show_symbol_reloading) (show_ext_args, show_download_write_size) (show_debug_file_directory): Ditto. * source.c (_initialize_source, show_lines_to_list): Ditto. * solib.c (_initialize_solib, show_auto_solib_add) (show_solib_search_path): Ditto. * p-valprint.c (_initialize_pascal_valprint) (show_pascal_static_field_print): Ditto. * printcmd.c (_initialize_printcmd, show_max_symbolic_offset) (show_print_symbol_filename): Add and update. * parse.c (_initialize_parse, show_expressiondebug): Dito. * observer.c (_initialize_observer, show_observer_debug): Dito. * maint.c (_initialize_maint_cmds, show_watchdog) (show_maintenance_profile_p): Dito. * linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito. * infrun.c (_initialize_infrun, show_debug_infrun) (show_stop_on_solib_events, show_follow_fork_mode_string) (show_scheduler_mode, show_step_stop_if_no_debug): Ditto. * infcall.c (_initialize_infcall, show_coerce_float_to_double_p) (show_unwind_on_signal_p): Ditto. * gdbtypes.c (build_gdbtypes, show_opaque_type_resolution) (_initialize_gdbtypes, show_overload_debug): Ditto. * gdb-events.c, gdb-events.sh (_initialize_gdb_events) (show_gdb_events_debug): Ditto. * gdbarch.c, gdbarch.sh (show_gdbarch_debug) (_initialize_gdbarch): Ditto. * frame.c (_initialize_frame, show_backtrace_past_main) (show_backtrace_past_entry, show_backtrace_limit) (show_frame_debug): Ditto. * exec.c (_initialize_exec, show_write_files): Ditto. * dwarf2read.c (_initialize_dwarf2_read) (show_dwarf2_max_cache_age): Ditto. * demangle.c (_initialize_demangler) (show_demangling_style_names): Ditto. * dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto. * cp-valprint.c (show_static_field_print) (_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto. * corefile.c (_initialize_core, show_gnutarget_string): Ditto. * cli/cli-logging.c (_initialize_cli_logging) (show_logging_overwrite, show_logging_redirect) (show_logging_filename): Ditto. * cli/cli-cmds.c (show_info_verbose, show_history_expansion_p) (init_cli_cmds, show_baud_rate, show_remote_debug) (show_remote_timeout, show_max_user_call_depth): Ditto. * charset.c (show_host_charset_name, show_target_charset_name) (initialize_charset): Ditto. * breakpoint.c (show_can_use_hw_watchpoints) (show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 14:51:36 +01:00
show_max_user_call_depth,
&setlist, &showlist);
2006-07-21 16:46:56 +02:00
add_setshow_boolean_cmd ("trace-commands", no_class, &trace_commands, _("\
Set tracing of GDB CLI commands."), _("\
Show state of GDB CLI command tracing."), _("\
When 'on', each command is displayed as it is executed."),
NULL,
NULL,
&setlist, &showlist);
2000-12-01 Fernando Nasser <fnasser@redhat.com> * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate.
2000-12-01 19:01:38 +01:00
}