binutils-gdb/gdb/language.c

1174 lines
32 KiB
C
Raw Normal View History

/* Multiple source language support for GDB.
Copyright (C) 1991-1996, 1998-2005, 2007-2012 Free Software
Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
1999-07-07 22:19:36 +02:00
This file is part of GDB.
1999-07-07 22:19:36 +02:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
1999-07-07 22:19:36 +02:00
(at your option) any later version.
1999-07-07 22:19:36 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1999-07-07 22:19:36 +02:00
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This file contains functions that return things that are specific
to languages. Each function should examine current_language if necessary,
and return the appropriate result. */
/* FIXME: Most of these would be better organized as macros which
return data out of a "language-specific" struct pointer that is set
whenever the working language changes. That would be a lot faster. */
#include "defs.h"
#include <ctype.h>
#include "gdb_string.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "gdbcmd.h"
#include "expression.h"
#include "language.h"
#include "target.h"
#include "parser-defs.h"
#include "jv-lang.h"
#include "demangle.h"
#include "symfile.h"
2000-05-28 03:12:42 +02:00
extern void _initialize_language (void);
1999-05-25 20:09:09 +02:00
2000-05-28 03:12:42 +02:00
static void unk_lang_error (char *);
2000-05-28 03:12:42 +02:00
static int unk_lang_parser (void);
2000-05-28 03:12:42 +02:00
static void show_check (char *, int);
2000-05-28 03:12:42 +02:00
static void set_check (char *, int);
static void set_type_range_case (void);
gdb: 2009-03-19 Tom Tromey <tromey@redhat.com> Julian Brown <julian@codesourcery.com> PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103, PR i18n/9401, PR exp/9613: * NEWS: Update * value.h (value_typed_string): Declare. (val_print_string): Update. * valprint.h (print_char_chars): Update. * valprint.c (print_char_chars): Add type argument. Update. (val_print_string): Likewise. * valops.c (value_typed_string): New function. * utils.c (host_char_to_target): New function. (parse_escape): Use host_char_to_target, host_hex_value. Update. Remove '^' case. (no_control_char_error): Remove. * typeprint.c (print_type_scalar): Update. * scm-valprint.c (scm_scmval_print): Update. * scm-lang.h (scm_printchar, scm_printstr): Update. * scm-lang.c (scm_printchar): Add type argument. (scm_printstr): Likewise. * printcmd.c (print_formatted): Update. (print_scalar_formatted): Update. (printf_command) <wide_string_arg, wide_char_arg>: New constants. Handle '%lc' and '%ls'. * parser-defs.h (struct typed_stoken): New type. (struct stoken_vector): Likewise. (write_exp_string_vector): Declare. * parse.c (write_exp_string_vector): New function. * p-valprint.c (pascal_val_print): Update. * p-lang.h (is_pascal_string_type, pascal_printchar, pascal_printstr): Update. * p-lang.c (is_pascal_string_type): Remove 'char_size' argument. Add 'char_type' argument. (pascal_emit_char): Add type argument. (pascal_printchar): Likewise. (pascal_printstr): Likewise. * objc-lang.c (objc_emit_char): Add type argument. (objc_printchar): Likewise. (objc_printstr): Likewise. * macroexp.c (get_character_constant): Handle unicode characters. Use c_parse_escape. (get_string_literal): Handle unicode strings. Use c_parse_escape. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Update. (m2_val_print): Update. * m2-lang.c (m2_emit_char): Add type argument. (m2_printchar): Likewise. (m2_printstr): Likewise. * language.h (struct language_defn) <la_printchar>: Add type argument. <la_printstr, la_emitchar>: Likewise. (LA_PRINT_CHAR): Likewise. (LA_PRINT_STRING): Likewise. (LA_EMIT_CHAR): Likewise. * language.c (unk_lang_emit_char): Add type argument. (unk_lang_printchar): Likewise. (unk_lang_printstr): Likewise. * jv-valprint.c (java_val_print): Update. * jv-lang.c (java_emit_char): Add type argument. * f-valprint.c (f_val_print): Update. * f-lang.c (f_emit_char): Add type argument. (f_printchar): Likewise. (f_printstr): Likewise. * expprint.c (print_subexp_standard): Update. * charset.h (target_wide_charset): Declare. (c_target_char_has_backslash_escape, c_parse_backslash, host_char_print_literally, host_char_to_target, target_char_to_host, target_char_to_control_char): Remove. (enum transliterations): New type. (convert_between_encodings): Declare. (HOST_ESCAPE_CHAR): New define. (host_letter_to_control_character, host_hex_value): Declare. (enum wchar_iterate_result): New enum. (struct wchar_iterator): Declare. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): Declare. * charset-list.h: New file. * c-valprint.c (textual_name): New function. (textual_element_type): Handle wide character types. (c_val_print): Pass original type to textual_element_type. Handle wide character types. (c_value_print): Use textual_element_type. Pass original type of value to val_print. * c-lang.h (enum c_string_type): New type. (c_printchar, c_printstr): Update. * c-lang.c (classify_type): New function. (print_wchar): Likewise. (c_emit_char): Add type argument. Handle wide characters. (c_printchar): Likewise. (c_printstr): Add type argument. Handle wide and multibyte character sets. (convert_ucn): New function. (emit_numeric_character): Likewise. (convert_octal): Likewise. (convert_hex): Likewise. (ADVANCE): New macro. (convert_escape): New function. (parse_one_string): Likewise. (evaluate_subexp_c): Likewise. (exp_descriptor_c): New global. (c_language_defn): Use exp_descriptor_c. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. (charset_for_string_type): New function. * c-exp.y (%union): Add 'svec' and 'tsval'. (CHAR): New token. (exp): Add CHAR production. (string_exp): Rewrite. (exp) <string_exp>: Rewrite. (tempbuf): Now global. (tempbuf_init): New global. (parse_string_or_char): New function. (yylex) <tempbuf>: Now global. <tokptr, tempbufindex, tempbufsize, token_string, class_prefix>: Remove. Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char. (c_parse_escape): New function. * auxv.c (fprint_target_auxv): Update. * ada-valprint.c (ada_emit_char): Add type argument. (ada_printchar): Likewise. (ada_print_scalar): Update. (printstr): Add type argument. Update calls to ada_emit_char. (ada_printstr): Add type argument. (ada_val_print_array): Update. (ada_val_print_1): Likewise. * ada-lang.c (emit_char): Add type argument. * ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add type arguments. * gdb_locale.h: Include langinfo.h. * charset.c (_initialize_charset): Set default host charset from the locale. Don't register charsets. Add target-wide-charset commands. Call find_charset_names. (struct charset, struct translation): Remove. (GDB_DEFAULT_HOST_CHARSET): Remove. (GDB_DEFAULT_TARGET_WIDE_CHARSET): New define. (target_wide_charset_name): New global. (show_host_charset_name): Handle "auto". (show_target_wide_charset_name): New function. (host_charset_enum, target_charset_enum): Remove. (charset_enum): New global. (all_charsets, register_charset, lookup_charset, all_translations, register_translation, lookup_translation): Remove. (simple_charset, ascii_print_literally, ascii_to_control): Remove. (iso_8859_print_literally, iso_8859_to_control, iso_8859_family_charset): Remove. (ebcdic_print_literally, ebcdic_to_control, ebcdic_family_charset): Remove. (struct cached_iconv, check_iconv_cache, cached_iconv_convert, register_iconv_charsets): Remove. (target_wide_charset_be_name, target_wide_charset_le_name): New globals. (identity_either_char_to_other): Remove. (set_be_le_names, validate): New functions. (backslashable, backslashed, represented): Remove. (default_c_target_char_has_backslash_escape): Remove. (default_c_parse_backslash, iconv_convert): Remove. (ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table, ascii_to_ibm1047_table, iso_8859_1_to_ascii_table, iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table, ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table, ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table, ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove. (table_convert_char, table_translation, simple_table_translation): Remove. (current_host_charset, current_target_charset, c_target_char_has_backslash_escape_func, c_target_char_has_backslash_escape_baton): Remove. (c_parse_backslash_func, c_parse_backslash_baton): Remove. (host_char_to_target_func, host_char_to_target_baton): Remove. (target_char_to_host_func, target_char_to_host_baton): Remove. (cached_iconv_host_to_target, cached_iconv_target_to_host): Remove. (lookup_charset_or_error, check_valid_host_charset): Remove. (set_host_and_target_charsets): Remove. (set_host_charset, set_target_charset): Remove. (set_host_charset_sfunc, set_target_charset_sfunc): Rewrite. (set_target_wide_charset_sfunc): New function. (show_charset): Print target wide character set. (host_charset, target_charset): Rewrite. (target_wide_charset): New function. (c_target_char_has_backslash_escape): Remove. (c_parse_backslash): Remove. (host_letter_to_control_character): New function. (host_char_print_literally): Remove. (host_hex_value): New function. (target_char_to_control_char): Remove. (cleanup_iconv): New function. (convert_between_encodings): New function. (target_char_to_host): Remove. (struct wchar_iterator): Define. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): New functions. (do_cleanup_iterator): New function. (char_ptr): New typedef. (charsets): New global. (add_one, find_charset_names): New functions. (default_charset_names): New global. (auto_host_charset_name): Likewise. * aclocal.m4, config.in, configure: Rebuild. * configure.ac: Call AM_LANGINFO_CODESET. (GDB_DEFAULT_HOST_CHARSET): Default to UTF-8. (AM_ICONV): Invoke earlier. * acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and LIBICONV_LIBDIR. Check for libiconv in build tree. * Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros. (INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE. (INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR. * gdb_obstack.h (obstack_grow_wstr): New define. * gdb_wchar.h: New file. * defs.h: Include it. gdb/testsuite: * gdb.base/store.exp: Update for change to escape output. * gdb.base/callfuncs.exp (fetch_all_registers): Update for change to escape output. * gdb.base/pointers.exp: Update for change to escape output. * gdb.base/long_long.exp (gdb_test_long_long): Update for change to escape output. * gdb.base/constvars.exp (do_constvar_tests): Update for change to escape output. * gdb.base/call-rt-st.exp (print_struct_call): Update for change to escape output. * gdb.cp/ref-types.exp (gdb_start_again): Update for change to escape output. * gdb.base/setvar.exp: Update for change to escape output. * lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C. * gdb.base/printcmds.exp (test_print_all_chars): Update for change to escape output. (test_print_string_constants): Likewise. * gdb.base/charset.exp (valid_host_charset): Check size of wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode cases. Handle "auto"-related output. * gdb.base/charset.c (char16_t, char32_t): New typedefs. (uvar, Uvar): New globals. gdb/doc: * gdb.texinfo (Character Sets): Remove obsolete text. Document set target-wide-charset. (Requirements): Mention iconv.
2009-03-21 00:04:40 +01:00
static void unk_lang_emit_char (int c, struct type *type,
struct ui_file *stream, int quoter);
gdb: 2009-03-19 Tom Tromey <tromey@redhat.com> Julian Brown <julian@codesourcery.com> PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103, PR i18n/9401, PR exp/9613: * NEWS: Update * value.h (value_typed_string): Declare. (val_print_string): Update. * valprint.h (print_char_chars): Update. * valprint.c (print_char_chars): Add type argument. Update. (val_print_string): Likewise. * valops.c (value_typed_string): New function. * utils.c (host_char_to_target): New function. (parse_escape): Use host_char_to_target, host_hex_value. Update. Remove '^' case. (no_control_char_error): Remove. * typeprint.c (print_type_scalar): Update. * scm-valprint.c (scm_scmval_print): Update. * scm-lang.h (scm_printchar, scm_printstr): Update. * scm-lang.c (scm_printchar): Add type argument. (scm_printstr): Likewise. * printcmd.c (print_formatted): Update. (print_scalar_formatted): Update. (printf_command) <wide_string_arg, wide_char_arg>: New constants. Handle '%lc' and '%ls'. * parser-defs.h (struct typed_stoken): New type. (struct stoken_vector): Likewise. (write_exp_string_vector): Declare. * parse.c (write_exp_string_vector): New function. * p-valprint.c (pascal_val_print): Update. * p-lang.h (is_pascal_string_type, pascal_printchar, pascal_printstr): Update. * p-lang.c (is_pascal_string_type): Remove 'char_size' argument. Add 'char_type' argument. (pascal_emit_char): Add type argument. (pascal_printchar): Likewise. (pascal_printstr): Likewise. * objc-lang.c (objc_emit_char): Add type argument. (objc_printchar): Likewise. (objc_printstr): Likewise. * macroexp.c (get_character_constant): Handle unicode characters. Use c_parse_escape. (get_string_literal): Handle unicode strings. Use c_parse_escape. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Update. (m2_val_print): Update. * m2-lang.c (m2_emit_char): Add type argument. (m2_printchar): Likewise. (m2_printstr): Likewise. * language.h (struct language_defn) <la_printchar>: Add type argument. <la_printstr, la_emitchar>: Likewise. (LA_PRINT_CHAR): Likewise. (LA_PRINT_STRING): Likewise. (LA_EMIT_CHAR): Likewise. * language.c (unk_lang_emit_char): Add type argument. (unk_lang_printchar): Likewise. (unk_lang_printstr): Likewise. * jv-valprint.c (java_val_print): Update. * jv-lang.c (java_emit_char): Add type argument. * f-valprint.c (f_val_print): Update. * f-lang.c (f_emit_char): Add type argument. (f_printchar): Likewise. (f_printstr): Likewise. * expprint.c (print_subexp_standard): Update. * charset.h (target_wide_charset): Declare. (c_target_char_has_backslash_escape, c_parse_backslash, host_char_print_literally, host_char_to_target, target_char_to_host, target_char_to_control_char): Remove. (enum transliterations): New type. (convert_between_encodings): Declare. (HOST_ESCAPE_CHAR): New define. (host_letter_to_control_character, host_hex_value): Declare. (enum wchar_iterate_result): New enum. (struct wchar_iterator): Declare. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): Declare. * charset-list.h: New file. * c-valprint.c (textual_name): New function. (textual_element_type): Handle wide character types. (c_val_print): Pass original type to textual_element_type. Handle wide character types. (c_value_print): Use textual_element_type. Pass original type of value to val_print. * c-lang.h (enum c_string_type): New type. (c_printchar, c_printstr): Update. * c-lang.c (classify_type): New function. (print_wchar): Likewise. (c_emit_char): Add type argument. Handle wide characters. (c_printchar): Likewise. (c_printstr): Add type argument. Handle wide and multibyte character sets. (convert_ucn): New function. (emit_numeric_character): Likewise. (convert_octal): Likewise. (convert_hex): Likewise. (ADVANCE): New macro. (convert_escape): New function. (parse_one_string): Likewise. (evaluate_subexp_c): Likewise. (exp_descriptor_c): New global. (c_language_defn): Use exp_descriptor_c. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. (charset_for_string_type): New function. * c-exp.y (%union): Add 'svec' and 'tsval'. (CHAR): New token. (exp): Add CHAR production. (string_exp): Rewrite. (exp) <string_exp>: Rewrite. (tempbuf): Now global. (tempbuf_init): New global. (parse_string_or_char): New function. (yylex) <tempbuf>: Now global. <tokptr, tempbufindex, tempbufsize, token_string, class_prefix>: Remove. Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char. (c_parse_escape): New function. * auxv.c (fprint_target_auxv): Update. * ada-valprint.c (ada_emit_char): Add type argument. (ada_printchar): Likewise. (ada_print_scalar): Update. (printstr): Add type argument. Update calls to ada_emit_char. (ada_printstr): Add type argument. (ada_val_print_array): Update. (ada_val_print_1): Likewise. * ada-lang.c (emit_char): Add type argument. * ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add type arguments. * gdb_locale.h: Include langinfo.h. * charset.c (_initialize_charset): Set default host charset from the locale. Don't register charsets. Add target-wide-charset commands. Call find_charset_names. (struct charset, struct translation): Remove. (GDB_DEFAULT_HOST_CHARSET): Remove. (GDB_DEFAULT_TARGET_WIDE_CHARSET): New define. (target_wide_charset_name): New global. (show_host_charset_name): Handle "auto". (show_target_wide_charset_name): New function. (host_charset_enum, target_charset_enum): Remove. (charset_enum): New global. (all_charsets, register_charset, lookup_charset, all_translations, register_translation, lookup_translation): Remove. (simple_charset, ascii_print_literally, ascii_to_control): Remove. (iso_8859_print_literally, iso_8859_to_control, iso_8859_family_charset): Remove. (ebcdic_print_literally, ebcdic_to_control, ebcdic_family_charset): Remove. (struct cached_iconv, check_iconv_cache, cached_iconv_convert, register_iconv_charsets): Remove. (target_wide_charset_be_name, target_wide_charset_le_name): New globals. (identity_either_char_to_other): Remove. (set_be_le_names, validate): New functions. (backslashable, backslashed, represented): Remove. (default_c_target_char_has_backslash_escape): Remove. (default_c_parse_backslash, iconv_convert): Remove. (ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table, ascii_to_ibm1047_table, iso_8859_1_to_ascii_table, iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table, ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table, ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table, ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove. (table_convert_char, table_translation, simple_table_translation): Remove. (current_host_charset, current_target_charset, c_target_char_has_backslash_escape_func, c_target_char_has_backslash_escape_baton): Remove. (c_parse_backslash_func, c_parse_backslash_baton): Remove. (host_char_to_target_func, host_char_to_target_baton): Remove. (target_char_to_host_func, target_char_to_host_baton): Remove. (cached_iconv_host_to_target, cached_iconv_target_to_host): Remove. (lookup_charset_or_error, check_valid_host_charset): Remove. (set_host_and_target_charsets): Remove. (set_host_charset, set_target_charset): Remove. (set_host_charset_sfunc, set_target_charset_sfunc): Rewrite. (set_target_wide_charset_sfunc): New function. (show_charset): Print target wide character set. (host_charset, target_charset): Rewrite. (target_wide_charset): New function. (c_target_char_has_backslash_escape): Remove. (c_parse_backslash): Remove. (host_letter_to_control_character): New function. (host_char_print_literally): Remove. (host_hex_value): New function. (target_char_to_control_char): Remove. (cleanup_iconv): New function. (convert_between_encodings): New function. (target_char_to_host): Remove. (struct wchar_iterator): Define. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): New functions. (do_cleanup_iterator): New function. (char_ptr): New typedef. (charsets): New global. (add_one, find_charset_names): New functions. (default_charset_names): New global. (auto_host_charset_name): Likewise. * aclocal.m4, config.in, configure: Rebuild. * configure.ac: Call AM_LANGINFO_CODESET. (GDB_DEFAULT_HOST_CHARSET): Default to UTF-8. (AM_ICONV): Invoke earlier. * acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and LIBICONV_LIBDIR. Check for libiconv in build tree. * Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros. (INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE. (INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR. * gdb_obstack.h (obstack_grow_wstr): New define. * gdb_wchar.h: New file. * defs.h: Include it. gdb/testsuite: * gdb.base/store.exp: Update for change to escape output. * gdb.base/callfuncs.exp (fetch_all_registers): Update for change to escape output. * gdb.base/pointers.exp: Update for change to escape output. * gdb.base/long_long.exp (gdb_test_long_long): Update for change to escape output. * gdb.base/constvars.exp (do_constvar_tests): Update for change to escape output. * gdb.base/call-rt-st.exp (print_struct_call): Update for change to escape output. * gdb.cp/ref-types.exp (gdb_start_again): Update for change to escape output. * gdb.base/setvar.exp: Update for change to escape output. * lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C. * gdb.base/printcmds.exp (test_print_all_chars): Update for change to escape output. (test_print_string_constants): Likewise. * gdb.base/charset.exp (valid_host_charset): Check size of wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode cases. Handle "auto"-related output. * gdb.base/charset.c (char16_t, char32_t): New typedefs. (uvar, Uvar): New globals. gdb/doc: * gdb.texinfo (Character Sets): Remove obsolete text. Document set target-wide-charset. (Requirements): Mention iconv.
2009-03-21 00:04:40 +01:00
static void unk_lang_printchar (int c, struct type *type,
struct ui_file *stream);
static void unk_lang_print_type (struct type *, const char *, struct ui_file *,
2000-02-02 01:21:19 +01:00
int, int);
static void unk_lang_value_print (struct value *, struct ui_file *,
const struct value_print_options *);
* gdbarch.sh (skip_trampoline_code): Add FRAME argument. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (generic_skip_trampoline_code): Add FRAME argument. * arch-utils.h (generic_skip_trampoline_code): Likewise. * infrun.c (handle_inferior_event): Pass current frame to gdbarch_skip_trampoline_code and skip_language_trampoline. * language.c (unk_lang_trampoline): Add FRAME argument. (skip_language_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * language.h: Add forward declaration of struct frame_info. (struct language_defn): Add FRAME argument to skip_trampoline. (skip_language_trampoline): Add FRAME argument. * cp-abi.c (cplus_skip_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * cp-abi.h: Add forward declaration of struct frame_info. (cplus_skip_trampoline): Add FRAME argument. (struct cp_abi_ops): Add FRAME argument to skip_trampoline callback. * gnu-v3-abi.c (gnuv3_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * objc-lang.c (objc_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * minsyms.c (find_solib_trampoline_target): Add FRAME argument. * symtab.h (find_solib_trampoline_target): Likewise. * obsd-tdep.c (obsd_skip_solib_resolver): Pass current frame to find_solib_trampoline_target. * arm-tdep.c (arm_skip_stub): Add FRAME argument. Read registers from FRAME instead of calling read_register. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_register. * hppa-tdep.c (hppa_skip_trampoline_code): Likewise. * hppa-tdep.h (hppa_skip_trampoline_code): Add FRAME argument. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Add FRAME argument. * m32c-tdep.c (m32c_skip_trampoline_code): Add FRAME argument. * mips-tdep.c (mips_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_signed_register. * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Add FRAME argument. (ppc64_standard_linkage_target): Likewise. Read registers from FRAME instead of using read_register. (ppc64_skip_trampoline_code): Add FRAME argument. Pass it to ppc64_standard_linkage_target. * rs6000-tdep.c (rs6000_skip_trampoline_code): Add FRAME argument. Pass it to find_solib_trampoline_target. Read registers from FRAME instead of using read_register. * xstormy16-tdep.c (xstormy16_skip_trampoline_code): Add FRAME argument.
2007-06-16 00:39:52 +02:00
static CORE_ADDR unk_lang_trampoline (struct frame_info *, CORE_ADDR pc);
/* Forward declaration */
extern const struct language_defn unknown_language_defn;
1999-07-07 22:19:36 +02:00
/* The current (default at startup) state of type and range checking.
1999-07-07 22:19:36 +02:00
(If the modes are set to "auto", though, these are changed based
on the default language at startup, and then again based on the
language of the first source file. */
enum range_mode range_mode = range_mode_auto;
enum range_check range_check = range_check_off;
enum type_mode type_mode = type_mode_auto;
enum type_check type_check = type_check_off;
enum case_mode case_mode = case_mode_auto;
enum case_sensitivity case_sensitivity = case_sensitive_on;
/* The current language and language_mode (see language.h). */
const struct language_defn *current_language = &unknown_language_defn;
enum language_mode language_mode = language_mode_auto;
/* The language that the user expects to be typing in (the language
of main(), or the last language we notified them about, or C). */
const struct language_defn *expected_language;
/* The list of supported languages. The list itself is malloc'd. */
static const struct language_defn **languages;
static unsigned languages_size;
static unsigned languages_allocsize;
#define DEFAULT_ALLOCSIZE 4
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
/* The current values of the "set language/type/range" enum
commands. */
static const char *language;
static const char *type;
static const char *range;
static const char *case_sensitive;
/* Warning issued when current_language and the language of the current
frame do not match. */
char lang_frame_mismatch_warn[] =
1999-07-07 22:19:36 +02:00
"Warning: the current language does not match this frame.";
/* This page contains the functions corresponding to GDB commands
and their helpers. */
/* Show command. Display a warning if the language set
does not match the frame. */
static void
show_language_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
enum language flang; /* The language of the current frame. */
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (language_mode == language_mode_auto)
fprintf_filtered (gdb_stdout,
_("The current source language is "
"\"auto; currently %s\".\n"),
current_language->la_name);
else
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
fprintf_filtered (gdb_stdout,
_("The current source language is \"%s\".\n"),
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
current_language->la_name);
1999-07-07 22:19:36 +02:00
flang = get_frame_language ();
if (flang != language_unknown &&
language_mode == language_mode_manual &&
current_language->la_language != flang)
printf_filtered ("%s\n", lang_frame_mismatch_warn);
}
/* Set command. Change the current working language. */
static void
set_language_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
int i;
enum language flang;
/* Search the list of languages for a match. */
1999-07-07 22:19:36 +02:00
for (i = 0; i < languages_size; i++)
{
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 (languages[i]->la_name, language) == 0)
1999-07-07 22:19:36 +02:00
{
/* Found it! Go into manual mode, and use this language. */
if (languages[i]->la_language == language_auto)
{
/* Enter auto mode. Set to the current frame's language, if
known, or fallback to the initial language. */
1999-07-07 22:19:36 +02:00
language_mode = language_mode_auto;
flang = get_frame_language ();
if (flang != language_unknown)
set_language (flang);
else
set_initial_language ();
1999-07-07 22:19:36 +02:00
expected_language = current_language;
return;
}
else
{
/* Enter manual mode. Set the specified language. */
language_mode = language_mode_manual;
current_language = languages[i];
set_type_range_case ();
1999-07-07 22:19:36 +02:00
expected_language = current_language;
return;
}
}
}
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
internal_error (__FILE__, __LINE__,
"Couldn't find language `%s' in known languages list.",
language);
}
/* Show command. Display a warning if the type setting does
not match the current language. */
static void
show_type_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (type_mode == type_mode_auto)
{
char *tmp = NULL;
switch (type_check)
{
case type_check_on:
tmp = "on";
break;
case type_check_off:
tmp = "off";
break;
case type_check_warn:
tmp = "warn";
break;
default:
internal_error (__FILE__, __LINE__,
"Unrecognized type check setting.");
}
fprintf_filtered (gdb_stdout,
_("Type checking is \"auto; currently %s\".\n"),
tmp);
}
else
fprintf_filtered (gdb_stdout, _("Type checking is \"%s\".\n"),
value);
if (type_check != current_language->la_type_check)
warning (_("the current type check setting"
" does not match the language.\n"));
}
/* Set command. Change the setting for type checking. */
static void
set_type_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
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 (type, "on") == 0)
1999-07-07 22:19:36 +02:00
{
type_check = type_check_on;
type_mode = type_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (type, "warn") == 0)
1999-07-07 22:19:36 +02:00
{
type_check = type_check_warn;
type_mode = type_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (type, "off") == 0)
1999-07-07 22:19:36 +02:00
{
type_check = type_check_off;
type_mode = type_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (type, "auto") == 0)
1999-07-07 22:19:36 +02:00
{
type_mode = type_mode_auto;
set_type_range_case ();
return;
1999-07-07 22:19:36 +02:00
}
1999-12-14 02:06:04 +01:00
else
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
internal_error (__FILE__, __LINE__,
_("Unrecognized type check setting: \"%s\""), type);
if (type_check != current_language->la_type_check)
warning (_("the current type check setting"
" does not match the language.\n"));
}
/* Show command. Display a warning if the range setting does
not match the current language. */
static void
show_range_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (range_mode == range_mode_auto)
{
char *tmp;
switch (range_check)
{
case range_check_on:
tmp = "on";
break;
case range_check_off:
tmp = "off";
break;
case range_check_warn:
tmp = "warn";
break;
default:
internal_error (__FILE__, __LINE__,
"Unrecognized range check setting.");
}
fprintf_filtered (gdb_stdout,
_("Range checking is \"auto; currently %s\".\n"),
tmp);
}
else
fprintf_filtered (gdb_stdout, _("Range checking is \"%s\".\n"),
value);
1999-07-07 22:19:36 +02:00
if (range_check != current_language->la_range_check)
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
warning (_("the current range check setting "
"does not match the language.\n"));
}
/* Set command. Change the setting for range checking. */
static void
set_range_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
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 (range, "on") == 0)
1999-07-07 22:19:36 +02:00
{
range_check = range_check_on;
range_mode = range_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (range, "warn") == 0)
1999-07-07 22:19:36 +02:00
{
range_check = range_check_warn;
range_mode = range_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (range, "off") == 0)
1999-07-07 22:19:36 +02:00
{
range_check = range_check_off;
range_mode = range_mode_manual;
1999-07-07 22:19:36 +02: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
else if (strcmp (range, "auto") == 0)
1999-07-07 22:19:36 +02:00
{
range_mode = range_mode_auto;
set_type_range_case ();
return;
1999-07-07 22:19:36 +02:00
}
1999-12-14 02:06:04 +01:00
else
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
internal_error (__FILE__, __LINE__,
_("Unrecognized range check setting: \"%s\""), range);
1999-12-14 02:06:04 +01:00
}
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (range_check != current_language->la_range_check)
warning (_("the current range check setting "
"does not match the language.\n"));
}
/* Show command. Display a warning if the case sensitivity setting does
not match the current language. */
static void
show_case_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (case_mode == case_mode_auto)
{
char *tmp = NULL;
switch (case_sensitivity)
{
case case_sensitive_on:
tmp = "on";
break;
case case_sensitive_off:
tmp = "off";
break;
default:
internal_error (__FILE__, __LINE__,
"Unrecognized case-sensitive setting.");
}
fprintf_filtered (gdb_stdout,
_("Case sensitivity in "
"name search is \"auto; currently %s\".\n"),
tmp);
}
else
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
fprintf_filtered (gdb_stdout,
_("Case sensitivity in name search is \"%s\".\n"),
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
value);
if (case_sensitivity != current_language->la_case_sensitivity)
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
warning (_("the current case sensitivity setting does not match "
"the language.\n"));
}
/* Set command. Change the setting for case sensitivity. */
static void
set_case_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
if (strcmp (case_sensitive, "on") == 0)
{
case_sensitivity = case_sensitive_on;
case_mode = case_mode_manual;
}
else if (strcmp (case_sensitive, "off") == 0)
{
case_sensitivity = case_sensitive_off;
case_mode = case_mode_manual;
}
else if (strcmp (case_sensitive, "auto") == 0)
{
case_mode = case_mode_auto;
set_type_range_case ();
return;
}
else
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
internal_error (__FILE__, __LINE__,
"Unrecognized case-sensitive setting: \"%s\"",
case_sensitive);
}
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
if (case_sensitivity != current_language->la_case_sensitivity)
warning (_("the current case sensitivity setting does not match "
"the language.\n"));
}
/* Set the status of range and type checking and case sensitivity based on
the current modes and the current language.
If SHOW is non-zero, then print out the current language,
type and range checking status. */
static void
set_type_range_case (void)
{
if (range_mode == range_mode_auto)
range_check = current_language->la_range_check;
if (type_mode == type_mode_auto)
type_check = current_language->la_type_check;
if (case_mode == case_mode_auto)
case_sensitivity = current_language->la_case_sensitivity;
}
/* Set current language to (enum language) LANG. Returns previous
language. */
enum language
2000-07-30 03:48:28 +02:00
set_language (enum language lang)
{
int i;
enum language prev_language;
prev_language = current_language->la_language;
1999-07-07 22:19:36 +02:00
for (i = 0; i < languages_size; i++)
{
if (languages[i]->la_language == lang)
{
current_language = languages[i];
set_type_range_case ();
1999-07-07 22:19:36 +02:00
break;
}
}
return prev_language;
}
/* Print out the current language settings: language, range and
type checking. If QUIETLY, print only what has changed. */
void
2000-07-30 03:48:28 +02:00
language_info (int quietly)
{
if (quietly && expected_language == current_language)
return;
expected_language = current_language;
printf_unfiltered (_("Current language: %s\n"), language);
show_language_command (NULL, 1, NULL, NULL);
if (!quietly)
{
printf_unfiltered (_("Type checking: %s\n"), type);
show_type_command (NULL, 1, NULL, NULL);
printf_unfiltered (_("Range checking: %s\n"), range);
show_range_command (NULL, 1, NULL, NULL);
printf_unfiltered (_("Case sensitivity: %s\n"), case_sensitive);
show_case_command (NULL, 1, NULL, NULL);
}
}
/* Returns non-zero if the value is a pointer type. */
int
2000-07-30 03:48:28 +02:00
pointer_type (struct type *type)
{
1999-07-07 22:19:36 +02:00
return TYPE_CODE (type) == TYPE_CODE_PTR ||
TYPE_CODE (type) == TYPE_CODE_REF;
}
/* This page contains functions that return info about
(struct value) values used in GDB. */
/* Returns non-zero if the value VAL represents a true value. */
int
2001-11-10 22:34:56 +01:00
value_true (struct value *val)
{
/* It is possible that we should have some sort of error if a non-boolean
value is used in this context. Possibly dependent on some kind of
"boolean-checking" option like range checking. But it should probably
not depend on the language except insofar as is necessary to identify
a "boolean" value (i.e. in C using a float, pointer, etc., as a boolean
should be an error, probably). */
return !value_logical_not (val);
}
/* This page contains functions for the printing out of
error messages that occur during type- and range-
checking. */
/* These are called when a language fails a type- or range-check. The
first argument should be a printf()-style format string, and the
rest of the arguments should be its arguments. If
[type|range]_check is [type|range]_check_on, an error is printed;
if [type|range]_check_warn, a warning; otherwise just the
message. */
void
type_error (const char *string,...)
{
1999-07-07 22:19:36 +02:00
va_list args;
va_start (args, string);
switch (type_check)
{
case type_check_warn:
vwarning (string, args);
break;
case type_check_on:
verror (string, args);
break;
case type_check_off:
/* FIXME: cagney/2002-01-30: Should this function print anything
when type error is off? */
vfprintf_filtered (gdb_stderr, string, args);
fprintf_filtered (gdb_stderr, "\n");
break;
default:
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
internal_error (__FILE__, __LINE__, _("bad switch"));
}
1999-07-07 22:19:36 +02:00
va_end (args);
}
void
range_error (const char *string,...)
{
1999-07-07 22:19:36 +02:00
va_list args;
va_start (args, string);
switch (range_check)
{
case range_check_warn:
vwarning (string, args);
break;
case range_check_on:
verror (string, args);
break;
case range_check_off:
/* FIXME: cagney/2002-01-30: Should this function print anything
when range error is off? */
vfprintf_filtered (gdb_stderr, string, args);
fprintf_filtered (gdb_stderr, "\n");
break;
default:
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
internal_error (__FILE__, __LINE__, _("bad switch"));
}
1999-07-07 22:19:36 +02:00
va_end (args);
}
1999-07-07 22:19:36 +02:00
/* This page contains miscellaneous functions. */
/* Return the language enum for a given language string. */
enum language
2000-07-30 03:48:28 +02:00
language_enum (char *str)
{
int i;
1999-07-07 22:19:36 +02:00
for (i = 0; i < languages_size; i++)
if (strcmp (languages[i]->la_name, str) == 0)
return languages[i]->la_language;
return language_unknown;
}
/* Return the language struct for a given language enum. */
const struct language_defn *
2000-07-30 03:48:28 +02:00
language_def (enum language lang)
{
int i;
1999-07-07 22:19:36 +02:00
for (i = 0; i < languages_size; i++)
{
if (languages[i]->la_language == lang)
{
return languages[i];
}
}
return NULL;
}
/* Return the language as a string. */
char *
2000-07-30 03:48:28 +02:00
language_str (enum language lang)
{
int i;
1999-07-07 22:19:36 +02:00
for (i = 0; i < languages_size; i++)
{
if (languages[i]->la_language == lang)
{
return languages[i]->la_name;
}
}
return "Unknown";
}
static void
2000-07-30 03:48:28 +02:00
set_check (char *ignore, int from_tty)
{
1999-07-07 22:19:36 +02:00
printf_unfiltered (
"\"set check\" must be followed by the name of a check subcommand.\n");
help_list (setchecklist, "set check ", -1, gdb_stdout);
}
static void
2000-07-30 03:48:28 +02:00
show_check (char *ignore, int from_tty)
{
1999-07-07 22:19:36 +02:00
cmd_show_list (showchecklist, from_tty, "");
}
/* Add a language to the set of known languages. */
void
2000-07-30 03:48:28 +02:00
add_language (const struct language_defn *lang)
{
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
/* For the "set language" command. */
static char **language_names = NULL;
/* For the "help set language" command. */
char *language_set_doc = NULL;
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
int i;
struct ui_file *tmp_stream;
if (lang->la_magic != LANG_MAGIC)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
fprintf_unfiltered (gdb_stderr,
"Magic number of %s language struct wrong\n",
1999-07-07 22:19:36 +02:00
lang->la_name);
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
internal_error (__FILE__, __LINE__,
_("failed internal consistency check"));
}
if (!languages)
{
languages_allocsize = DEFAULT_ALLOCSIZE;
languages = (const struct language_defn **) xmalloc
(languages_allocsize * sizeof (*languages));
}
if (languages_size >= languages_allocsize)
{
languages_allocsize *= 2;
languages = (const struct language_defn **) xrealloc ((char *) languages,
1999-07-07 22:19:36 +02:00
languages_allocsize * sizeof (*languages));
}
languages[languages_size++] = lang;
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
/* Build the language names array, to be used as enumeration in the
set language" enum command. */
language_names = xrealloc (language_names,
(languages_size + 1) * sizeof (const char *));
for (i = 0; i < languages_size; ++i)
language_names[i] = languages[i]->la_name;
language_names[i] = NULL;
/* Build the "help set language" docs. */
tmp_stream = mem_fileopen ();
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
fprintf_unfiltered (tmp_stream,
_("Set the current source language.\n"
"The currently understood settings are:\n\nlocal or "
"auto Automatic setting based on source file\n"));
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
for (i = 0; i < languages_size; ++i)
{
/* Already dealt with these above. */
if (languages[i]->la_language == language_unknown
|| languages[i]->la_language == language_auto)
continue;
/* FIXME: i18n: for now assume that the human-readable name
is just a capitalization of the internal name. */
fprintf_unfiltered (tmp_stream, "%-16s Use the %c%s language\n",
languages[i]->la_name,
/* Capitalize first letter of language
name. */
toupper (languages[i]->la_name[0]),
languages[i]->la_name + 1);
}
language_set_doc = ui_file_xstrdup (tmp_stream, NULL);
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
ui_file_delete (tmp_stream);
add_setshow_enum_cmd ("language", class_support,
(const char **) language_names,
&language,
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
language_set_doc,
_("Show the current source language."),
NULL, set_language_command,
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
show_language_command,
&setlist, &showlist);
xfree (language_set_doc);
}
/* Iterate through all registered languages looking for and calling
any non-NULL struct language_defn.skip_trampoline() functions.
Return the result from the first that returns non-zero, or 0 if all
`fail'. */
CORE_ADDR
* gdbarch.sh (skip_trampoline_code): Add FRAME argument. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (generic_skip_trampoline_code): Add FRAME argument. * arch-utils.h (generic_skip_trampoline_code): Likewise. * infrun.c (handle_inferior_event): Pass current frame to gdbarch_skip_trampoline_code and skip_language_trampoline. * language.c (unk_lang_trampoline): Add FRAME argument. (skip_language_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * language.h: Add forward declaration of struct frame_info. (struct language_defn): Add FRAME argument to skip_trampoline. (skip_language_trampoline): Add FRAME argument. * cp-abi.c (cplus_skip_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * cp-abi.h: Add forward declaration of struct frame_info. (cplus_skip_trampoline): Add FRAME argument. (struct cp_abi_ops): Add FRAME argument to skip_trampoline callback. * gnu-v3-abi.c (gnuv3_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * objc-lang.c (objc_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * minsyms.c (find_solib_trampoline_target): Add FRAME argument. * symtab.h (find_solib_trampoline_target): Likewise. * obsd-tdep.c (obsd_skip_solib_resolver): Pass current frame to find_solib_trampoline_target. * arm-tdep.c (arm_skip_stub): Add FRAME argument. Read registers from FRAME instead of calling read_register. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_register. * hppa-tdep.c (hppa_skip_trampoline_code): Likewise. * hppa-tdep.h (hppa_skip_trampoline_code): Add FRAME argument. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Add FRAME argument. * m32c-tdep.c (m32c_skip_trampoline_code): Add FRAME argument. * mips-tdep.c (mips_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_signed_register. * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Add FRAME argument. (ppc64_standard_linkage_target): Likewise. Read registers from FRAME instead of using read_register. (ppc64_skip_trampoline_code): Add FRAME argument. Pass it to ppc64_standard_linkage_target. * rs6000-tdep.c (rs6000_skip_trampoline_code): Add FRAME argument. Pass it to find_solib_trampoline_target. Read registers from FRAME instead of using read_register. * xstormy16-tdep.c (xstormy16_skip_trampoline_code): Add FRAME argument.
2007-06-16 00:39:52 +02:00
skip_language_trampoline (struct frame_info *frame, CORE_ADDR pc)
{
int i;
for (i = 0; i < languages_size; i++)
{
if (languages[i]->skip_trampoline)
{
* gdbarch.sh (skip_trampoline_code): Add FRAME argument. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (generic_skip_trampoline_code): Add FRAME argument. * arch-utils.h (generic_skip_trampoline_code): Likewise. * infrun.c (handle_inferior_event): Pass current frame to gdbarch_skip_trampoline_code and skip_language_trampoline. * language.c (unk_lang_trampoline): Add FRAME argument. (skip_language_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * language.h: Add forward declaration of struct frame_info. (struct language_defn): Add FRAME argument to skip_trampoline. (skip_language_trampoline): Add FRAME argument. * cp-abi.c (cplus_skip_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * cp-abi.h: Add forward declaration of struct frame_info. (cplus_skip_trampoline): Add FRAME argument. (struct cp_abi_ops): Add FRAME argument to skip_trampoline callback. * gnu-v3-abi.c (gnuv3_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * objc-lang.c (objc_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * minsyms.c (find_solib_trampoline_target): Add FRAME argument. * symtab.h (find_solib_trampoline_target): Likewise. * obsd-tdep.c (obsd_skip_solib_resolver): Pass current frame to find_solib_trampoline_target. * arm-tdep.c (arm_skip_stub): Add FRAME argument. Read registers from FRAME instead of calling read_register. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_register. * hppa-tdep.c (hppa_skip_trampoline_code): Likewise. * hppa-tdep.h (hppa_skip_trampoline_code): Add FRAME argument. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Add FRAME argument. * m32c-tdep.c (m32c_skip_trampoline_code): Add FRAME argument. * mips-tdep.c (mips_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_signed_register. * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Add FRAME argument. (ppc64_standard_linkage_target): Likewise. Read registers from FRAME instead of using read_register. (ppc64_skip_trampoline_code): Add FRAME argument. Pass it to ppc64_standard_linkage_target. * rs6000-tdep.c (rs6000_skip_trampoline_code): Add FRAME argument. Pass it to find_solib_trampoline_target. Read registers from FRAME instead of using read_register. * xstormy16-tdep.c (xstormy16_skip_trampoline_code): Add FRAME argument.
2007-06-16 00:39:52 +02:00
CORE_ADDR real_pc = (languages[i]->skip_trampoline) (frame, pc);
if (real_pc)
return real_pc;
}
}
return 0;
}
/* Return demangled language symbol, or NULL.
FIXME: Options are only useful for certain languages and ignored
by others, so it would be better to remove them here and have a
more flexible demangler for the languages that need it.
FIXME: Sometimes the demangler is invoked when we don't know the
language, so we can't use this everywhere. */
char *
language_demangle (const struct language_defn *current_language,
const char *mangled, int options)
{
if (current_language != NULL && current_language->la_demangle)
return current_language->la_demangle (mangled, options);
return NULL;
}
/* Return class name from physname or NULL. */
char *
language_class_name_from_physname (const struct language_defn *lang,
const char *physname)
{
if (lang != NULL && lang->la_class_name_from_physname)
return lang->la_class_name_from_physname (physname);
return NULL;
}
/* Return non-zero if TYPE should be passed (and returned) by
reference at the language level. */
int
language_pass_by_reference (struct type *type)
{
return current_language->la_pass_by_reference (type);
}
/* Return zero; by default, types are passed by value at the language
level. The target ABI may pass or return some structs by reference
independent of this. */
int
default_pass_by_reference (struct type *type)
{
return 0;
}
/* Return the default string containing the list of characters
delimiting words. This is a reasonable default value that
most languages should be able to use. */
char *
default_word_break_characters (void)
{
return " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
}
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
/* Print the index of array elements using the C99 syntax. */
void
default_print_array_index (struct value *index_value, struct ui_file *stream,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
const struct value_print_options *options)
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
{
fprintf_filtered (stream, "[");
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
LA_VALUE_PRINT (index_value, stream, options);
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
fprintf_filtered (stream, "] = ");
}
void
default_get_string (struct value *value, gdb_byte **buffer, int *length,
struct type **char_type, const char **charset)
{
error (_("Getting a string is unsupported in this language."));
}
/* Define the language that is no language. */
static int
2000-07-30 03:48:28 +02:00
unk_lang_parser (void)
{
return 1;
}
static void
2000-07-30 03:48:28 +02:00
unk_lang_error (char *msg)
{
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 (_("Attempted to parse an expression with unknown language"));
}
static void
gdb: 2009-03-19 Tom Tromey <tromey@redhat.com> Julian Brown <julian@codesourcery.com> PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103, PR i18n/9401, PR exp/9613: * NEWS: Update * value.h (value_typed_string): Declare. (val_print_string): Update. * valprint.h (print_char_chars): Update. * valprint.c (print_char_chars): Add type argument. Update. (val_print_string): Likewise. * valops.c (value_typed_string): New function. * utils.c (host_char_to_target): New function. (parse_escape): Use host_char_to_target, host_hex_value. Update. Remove '^' case. (no_control_char_error): Remove. * typeprint.c (print_type_scalar): Update. * scm-valprint.c (scm_scmval_print): Update. * scm-lang.h (scm_printchar, scm_printstr): Update. * scm-lang.c (scm_printchar): Add type argument. (scm_printstr): Likewise. * printcmd.c (print_formatted): Update. (print_scalar_formatted): Update. (printf_command) <wide_string_arg, wide_char_arg>: New constants. Handle '%lc' and '%ls'. * parser-defs.h (struct typed_stoken): New type. (struct stoken_vector): Likewise. (write_exp_string_vector): Declare. * parse.c (write_exp_string_vector): New function. * p-valprint.c (pascal_val_print): Update. * p-lang.h (is_pascal_string_type, pascal_printchar, pascal_printstr): Update. * p-lang.c (is_pascal_string_type): Remove 'char_size' argument. Add 'char_type' argument. (pascal_emit_char): Add type argument. (pascal_printchar): Likewise. (pascal_printstr): Likewise. * objc-lang.c (objc_emit_char): Add type argument. (objc_printchar): Likewise. (objc_printstr): Likewise. * macroexp.c (get_character_constant): Handle unicode characters. Use c_parse_escape. (get_string_literal): Handle unicode strings. Use c_parse_escape. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Update. (m2_val_print): Update. * m2-lang.c (m2_emit_char): Add type argument. (m2_printchar): Likewise. (m2_printstr): Likewise. * language.h (struct language_defn) <la_printchar>: Add type argument. <la_printstr, la_emitchar>: Likewise. (LA_PRINT_CHAR): Likewise. (LA_PRINT_STRING): Likewise. (LA_EMIT_CHAR): Likewise. * language.c (unk_lang_emit_char): Add type argument. (unk_lang_printchar): Likewise. (unk_lang_printstr): Likewise. * jv-valprint.c (java_val_print): Update. * jv-lang.c (java_emit_char): Add type argument. * f-valprint.c (f_val_print): Update. * f-lang.c (f_emit_char): Add type argument. (f_printchar): Likewise. (f_printstr): Likewise. * expprint.c (print_subexp_standard): Update. * charset.h (target_wide_charset): Declare. (c_target_char_has_backslash_escape, c_parse_backslash, host_char_print_literally, host_char_to_target, target_char_to_host, target_char_to_control_char): Remove. (enum transliterations): New type. (convert_between_encodings): Declare. (HOST_ESCAPE_CHAR): New define. (host_letter_to_control_character, host_hex_value): Declare. (enum wchar_iterate_result): New enum. (struct wchar_iterator): Declare. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): Declare. * charset-list.h: New file. * c-valprint.c (textual_name): New function. (textual_element_type): Handle wide character types. (c_val_print): Pass original type to textual_element_type. Handle wide character types. (c_value_print): Use textual_element_type. Pass original type of value to val_print. * c-lang.h (enum c_string_type): New type. (c_printchar, c_printstr): Update. * c-lang.c (classify_type): New function. (print_wchar): Likewise. (c_emit_char): Add type argument. Handle wide characters. (c_printchar): Likewise. (c_printstr): Add type argument. Handle wide and multibyte character sets. (convert_ucn): New function. (emit_numeric_character): Likewise. (convert_octal): Likewise. (convert_hex): Likewise. (ADVANCE): New macro. (convert_escape): New function. (parse_one_string): Likewise. (evaluate_subexp_c): Likewise. (exp_descriptor_c): New global. (c_language_defn): Use exp_descriptor_c. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. (charset_for_string_type): New function. * c-exp.y (%union): Add 'svec' and 'tsval'. (CHAR): New token. (exp): Add CHAR production. (string_exp): Rewrite. (exp) <string_exp>: Rewrite. (tempbuf): Now global. (tempbuf_init): New global. (parse_string_or_char): New function. (yylex) <tempbuf>: Now global. <tokptr, tempbufindex, tempbufsize, token_string, class_prefix>: Remove. Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char. (c_parse_escape): New function. * auxv.c (fprint_target_auxv): Update. * ada-valprint.c (ada_emit_char): Add type argument. (ada_printchar): Likewise. (ada_print_scalar): Update. (printstr): Add type argument. Update calls to ada_emit_char. (ada_printstr): Add type argument. (ada_val_print_array): Update. (ada_val_print_1): Likewise. * ada-lang.c (emit_char): Add type argument. * ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add type arguments. * gdb_locale.h: Include langinfo.h. * charset.c (_initialize_charset): Set default host charset from the locale. Don't register charsets. Add target-wide-charset commands. Call find_charset_names. (struct charset, struct translation): Remove. (GDB_DEFAULT_HOST_CHARSET): Remove. (GDB_DEFAULT_TARGET_WIDE_CHARSET): New define. (target_wide_charset_name): New global. (show_host_charset_name): Handle "auto". (show_target_wide_charset_name): New function. (host_charset_enum, target_charset_enum): Remove. (charset_enum): New global. (all_charsets, register_charset, lookup_charset, all_translations, register_translation, lookup_translation): Remove. (simple_charset, ascii_print_literally, ascii_to_control): Remove. (iso_8859_print_literally, iso_8859_to_control, iso_8859_family_charset): Remove. (ebcdic_print_literally, ebcdic_to_control, ebcdic_family_charset): Remove. (struct cached_iconv, check_iconv_cache, cached_iconv_convert, register_iconv_charsets): Remove. (target_wide_charset_be_name, target_wide_charset_le_name): New globals. (identity_either_char_to_other): Remove. (set_be_le_names, validate): New functions. (backslashable, backslashed, represented): Remove. (default_c_target_char_has_backslash_escape): Remove. (default_c_parse_backslash, iconv_convert): Remove. (ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table, ascii_to_ibm1047_table, iso_8859_1_to_ascii_table, iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table, ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table, ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table, ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove. (table_convert_char, table_translation, simple_table_translation): Remove. (current_host_charset, current_target_charset, c_target_char_has_backslash_escape_func, c_target_char_has_backslash_escape_baton): Remove. (c_parse_backslash_func, c_parse_backslash_baton): Remove. (host_char_to_target_func, host_char_to_target_baton): Remove. (target_char_to_host_func, target_char_to_host_baton): Remove. (cached_iconv_host_to_target, cached_iconv_target_to_host): Remove. (lookup_charset_or_error, check_valid_host_charset): Remove. (set_host_and_target_charsets): Remove. (set_host_charset, set_target_charset): Remove. (set_host_charset_sfunc, set_target_charset_sfunc): Rewrite. (set_target_wide_charset_sfunc): New function. (show_charset): Print target wide character set. (host_charset, target_charset): Rewrite. (target_wide_charset): New function. (c_target_char_has_backslash_escape): Remove. (c_parse_backslash): Remove. (host_letter_to_control_character): New function. (host_char_print_literally): Remove. (host_hex_value): New function. (target_char_to_control_char): Remove. (cleanup_iconv): New function. (convert_between_encodings): New function. (target_char_to_host): Remove. (struct wchar_iterator): Define. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): New functions. (do_cleanup_iterator): New function. (char_ptr): New typedef. (charsets): New global. (add_one, find_charset_names): New functions. (default_charset_names): New global. (auto_host_charset_name): Likewise. * aclocal.m4, config.in, configure: Rebuild. * configure.ac: Call AM_LANGINFO_CODESET. (GDB_DEFAULT_HOST_CHARSET): Default to UTF-8. (AM_ICONV): Invoke earlier. * acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and LIBICONV_LIBDIR. Check for libiconv in build tree. * Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros. (INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE. (INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR. * gdb_obstack.h (obstack_grow_wstr): New define. * gdb_wchar.h: New file. * defs.h: Include it. gdb/testsuite: * gdb.base/store.exp: Update for change to escape output. * gdb.base/callfuncs.exp (fetch_all_registers): Update for change to escape output. * gdb.base/pointers.exp: Update for change to escape output. * gdb.base/long_long.exp (gdb_test_long_long): Update for change to escape output. * gdb.base/constvars.exp (do_constvar_tests): Update for change to escape output. * gdb.base/call-rt-st.exp (print_struct_call): Update for change to escape output. * gdb.cp/ref-types.exp (gdb_start_again): Update for change to escape output. * gdb.base/setvar.exp: Update for change to escape output. * lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C. * gdb.base/printcmds.exp (test_print_all_chars): Update for change to escape output. (test_print_string_constants): Likewise. * gdb.base/charset.exp (valid_host_charset): Check size of wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode cases. Handle "auto"-related output. * gdb.base/charset.c (char16_t, char32_t): New typedefs. (uvar, Uvar): New globals. gdb/doc: * gdb.texinfo (Character Sets): Remove obsolete text. Document set target-wide-charset. (Requirements): Mention iconv.
2009-03-21 00:04:40 +01:00
unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
int quoter)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_emit_char called."));
}
static void
gdb: 2009-03-19 Tom Tromey <tromey@redhat.com> Julian Brown <julian@codesourcery.com> PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103, PR i18n/9401, PR exp/9613: * NEWS: Update * value.h (value_typed_string): Declare. (val_print_string): Update. * valprint.h (print_char_chars): Update. * valprint.c (print_char_chars): Add type argument. Update. (val_print_string): Likewise. * valops.c (value_typed_string): New function. * utils.c (host_char_to_target): New function. (parse_escape): Use host_char_to_target, host_hex_value. Update. Remove '^' case. (no_control_char_error): Remove. * typeprint.c (print_type_scalar): Update. * scm-valprint.c (scm_scmval_print): Update. * scm-lang.h (scm_printchar, scm_printstr): Update. * scm-lang.c (scm_printchar): Add type argument. (scm_printstr): Likewise. * printcmd.c (print_formatted): Update. (print_scalar_formatted): Update. (printf_command) <wide_string_arg, wide_char_arg>: New constants. Handle '%lc' and '%ls'. * parser-defs.h (struct typed_stoken): New type. (struct stoken_vector): Likewise. (write_exp_string_vector): Declare. * parse.c (write_exp_string_vector): New function. * p-valprint.c (pascal_val_print): Update. * p-lang.h (is_pascal_string_type, pascal_printchar, pascal_printstr): Update. * p-lang.c (is_pascal_string_type): Remove 'char_size' argument. Add 'char_type' argument. (pascal_emit_char): Add type argument. (pascal_printchar): Likewise. (pascal_printstr): Likewise. * objc-lang.c (objc_emit_char): Add type argument. (objc_printchar): Likewise. (objc_printstr): Likewise. * macroexp.c (get_character_constant): Handle unicode characters. Use c_parse_escape. (get_string_literal): Handle unicode strings. Use c_parse_escape. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Update. (m2_val_print): Update. * m2-lang.c (m2_emit_char): Add type argument. (m2_printchar): Likewise. (m2_printstr): Likewise. * language.h (struct language_defn) <la_printchar>: Add type argument. <la_printstr, la_emitchar>: Likewise. (LA_PRINT_CHAR): Likewise. (LA_PRINT_STRING): Likewise. (LA_EMIT_CHAR): Likewise. * language.c (unk_lang_emit_char): Add type argument. (unk_lang_printchar): Likewise. (unk_lang_printstr): Likewise. * jv-valprint.c (java_val_print): Update. * jv-lang.c (java_emit_char): Add type argument. * f-valprint.c (f_val_print): Update. * f-lang.c (f_emit_char): Add type argument. (f_printchar): Likewise. (f_printstr): Likewise. * expprint.c (print_subexp_standard): Update. * charset.h (target_wide_charset): Declare. (c_target_char_has_backslash_escape, c_parse_backslash, host_char_print_literally, host_char_to_target, target_char_to_host, target_char_to_control_char): Remove. (enum transliterations): New type. (convert_between_encodings): Declare. (HOST_ESCAPE_CHAR): New define. (host_letter_to_control_character, host_hex_value): Declare. (enum wchar_iterate_result): New enum. (struct wchar_iterator): Declare. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): Declare. * charset-list.h: New file. * c-valprint.c (textual_name): New function. (textual_element_type): Handle wide character types. (c_val_print): Pass original type to textual_element_type. Handle wide character types. (c_value_print): Use textual_element_type. Pass original type of value to val_print. * c-lang.h (enum c_string_type): New type. (c_printchar, c_printstr): Update. * c-lang.c (classify_type): New function. (print_wchar): Likewise. (c_emit_char): Add type argument. Handle wide characters. (c_printchar): Likewise. (c_printstr): Add type argument. Handle wide and multibyte character sets. (convert_ucn): New function. (emit_numeric_character): Likewise. (convert_octal): Likewise. (convert_hex): Likewise. (ADVANCE): New macro. (convert_escape): New function. (parse_one_string): Likewise. (evaluate_subexp_c): Likewise. (exp_descriptor_c): New global. (c_language_defn): Use exp_descriptor_c. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. (charset_for_string_type): New function. * c-exp.y (%union): Add 'svec' and 'tsval'. (CHAR): New token. (exp): Add CHAR production. (string_exp): Rewrite. (exp) <string_exp>: Rewrite. (tempbuf): Now global. (tempbuf_init): New global. (parse_string_or_char): New function. (yylex) <tempbuf>: Now global. <tokptr, tempbufindex, tempbufsize, token_string, class_prefix>: Remove. Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char. (c_parse_escape): New function. * auxv.c (fprint_target_auxv): Update. * ada-valprint.c (ada_emit_char): Add type argument. (ada_printchar): Likewise. (ada_print_scalar): Update. (printstr): Add type argument. Update calls to ada_emit_char. (ada_printstr): Add type argument. (ada_val_print_array): Update. (ada_val_print_1): Likewise. * ada-lang.c (emit_char): Add type argument. * ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add type arguments. * gdb_locale.h: Include langinfo.h. * charset.c (_initialize_charset): Set default host charset from the locale. Don't register charsets. Add target-wide-charset commands. Call find_charset_names. (struct charset, struct translation): Remove. (GDB_DEFAULT_HOST_CHARSET): Remove. (GDB_DEFAULT_TARGET_WIDE_CHARSET): New define. (target_wide_charset_name): New global. (show_host_charset_name): Handle "auto". (show_target_wide_charset_name): New function. (host_charset_enum, target_charset_enum): Remove. (charset_enum): New global. (all_charsets, register_charset, lookup_charset, all_translations, register_translation, lookup_translation): Remove. (simple_charset, ascii_print_literally, ascii_to_control): Remove. (iso_8859_print_literally, iso_8859_to_control, iso_8859_family_charset): Remove. (ebcdic_print_literally, ebcdic_to_control, ebcdic_family_charset): Remove. (struct cached_iconv, check_iconv_cache, cached_iconv_convert, register_iconv_charsets): Remove. (target_wide_charset_be_name, target_wide_charset_le_name): New globals. (identity_either_char_to_other): Remove. (set_be_le_names, validate): New functions. (backslashable, backslashed, represented): Remove. (default_c_target_char_has_backslash_escape): Remove. (default_c_parse_backslash, iconv_convert): Remove. (ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table, ascii_to_ibm1047_table, iso_8859_1_to_ascii_table, iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table, ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table, ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table, ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove. (table_convert_char, table_translation, simple_table_translation): Remove. (current_host_charset, current_target_charset, c_target_char_has_backslash_escape_func, c_target_char_has_backslash_escape_baton): Remove. (c_parse_backslash_func, c_parse_backslash_baton): Remove. (host_char_to_target_func, host_char_to_target_baton): Remove. (target_char_to_host_func, target_char_to_host_baton): Remove. (cached_iconv_host_to_target, cached_iconv_target_to_host): Remove. (lookup_charset_or_error, check_valid_host_charset): Remove. (set_host_and_target_charsets): Remove. (set_host_charset, set_target_charset): Remove. (set_host_charset_sfunc, set_target_charset_sfunc): Rewrite. (set_target_wide_charset_sfunc): New function. (show_charset): Print target wide character set. (host_charset, target_charset): Rewrite. (target_wide_charset): New function. (c_target_char_has_backslash_escape): Remove. (c_parse_backslash): Remove. (host_letter_to_control_character): New function. (host_char_print_literally): Remove. (host_hex_value): New function. (target_char_to_control_char): Remove. (cleanup_iconv): New function. (convert_between_encodings): New function. (target_char_to_host): Remove. (struct wchar_iterator): Define. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): New functions. (do_cleanup_iterator): New function. (char_ptr): New typedef. (charsets): New global. (add_one, find_charset_names): New functions. (default_charset_names): New global. (auto_host_charset_name): Likewise. * aclocal.m4, config.in, configure: Rebuild. * configure.ac: Call AM_LANGINFO_CODESET. (GDB_DEFAULT_HOST_CHARSET): Default to UTF-8. (AM_ICONV): Invoke earlier. * acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and LIBICONV_LIBDIR. Check for libiconv in build tree. * Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros. (INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE. (INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR. * gdb_obstack.h (obstack_grow_wstr): New define. * gdb_wchar.h: New file. * defs.h: Include it. gdb/testsuite: * gdb.base/store.exp: Update for change to escape output. * gdb.base/callfuncs.exp (fetch_all_registers): Update for change to escape output. * gdb.base/pointers.exp: Update for change to escape output. * gdb.base/long_long.exp (gdb_test_long_long): Update for change to escape output. * gdb.base/constvars.exp (do_constvar_tests): Update for change to escape output. * gdb.base/call-rt-st.exp (print_struct_call): Update for change to escape output. * gdb.cp/ref-types.exp (gdb_start_again): Update for change to escape output. * gdb.base/setvar.exp: Update for change to escape output. * lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C. * gdb.base/printcmds.exp (test_print_all_chars): Update for change to escape output. (test_print_string_constants): Likewise. * gdb.base/charset.exp (valid_host_charset): Check size of wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode cases. Handle "auto"-related output. * gdb.base/charset.c (char16_t, char32_t): New typedefs. (uvar, Uvar): New globals. gdb/doc: * gdb.texinfo (Character Sets): Remove obsolete text. Document set target-wide-charset. (Requirements): Mention iconv.
2009-03-21 00:04:40 +01:00
unk_lang_printchar (int c, struct type *type, struct ui_file *stream)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_printchar called."));
}
static void
gdb: 2009-03-19 Tom Tromey <tromey@redhat.com> Julian Brown <julian@codesourcery.com> PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103, PR i18n/9401, PR exp/9613: * NEWS: Update * value.h (value_typed_string): Declare. (val_print_string): Update. * valprint.h (print_char_chars): Update. * valprint.c (print_char_chars): Add type argument. Update. (val_print_string): Likewise. * valops.c (value_typed_string): New function. * utils.c (host_char_to_target): New function. (parse_escape): Use host_char_to_target, host_hex_value. Update. Remove '^' case. (no_control_char_error): Remove. * typeprint.c (print_type_scalar): Update. * scm-valprint.c (scm_scmval_print): Update. * scm-lang.h (scm_printchar, scm_printstr): Update. * scm-lang.c (scm_printchar): Add type argument. (scm_printstr): Likewise. * printcmd.c (print_formatted): Update. (print_scalar_formatted): Update. (printf_command) <wide_string_arg, wide_char_arg>: New constants. Handle '%lc' and '%ls'. * parser-defs.h (struct typed_stoken): New type. (struct stoken_vector): Likewise. (write_exp_string_vector): Declare. * parse.c (write_exp_string_vector): New function. * p-valprint.c (pascal_val_print): Update. * p-lang.h (is_pascal_string_type, pascal_printchar, pascal_printstr): Update. * p-lang.c (is_pascal_string_type): Remove 'char_size' argument. Add 'char_type' argument. (pascal_emit_char): Add type argument. (pascal_printchar): Likewise. (pascal_printstr): Likewise. * objc-lang.c (objc_emit_char): Add type argument. (objc_printchar): Likewise. (objc_printstr): Likewise. * macroexp.c (get_character_constant): Handle unicode characters. Use c_parse_escape. (get_string_literal): Handle unicode strings. Use c_parse_escape. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Update. (m2_val_print): Update. * m2-lang.c (m2_emit_char): Add type argument. (m2_printchar): Likewise. (m2_printstr): Likewise. * language.h (struct language_defn) <la_printchar>: Add type argument. <la_printstr, la_emitchar>: Likewise. (LA_PRINT_CHAR): Likewise. (LA_PRINT_STRING): Likewise. (LA_EMIT_CHAR): Likewise. * language.c (unk_lang_emit_char): Add type argument. (unk_lang_printchar): Likewise. (unk_lang_printstr): Likewise. * jv-valprint.c (java_val_print): Update. * jv-lang.c (java_emit_char): Add type argument. * f-valprint.c (f_val_print): Update. * f-lang.c (f_emit_char): Add type argument. (f_printchar): Likewise. (f_printstr): Likewise. * expprint.c (print_subexp_standard): Update. * charset.h (target_wide_charset): Declare. (c_target_char_has_backslash_escape, c_parse_backslash, host_char_print_literally, host_char_to_target, target_char_to_host, target_char_to_control_char): Remove. (enum transliterations): New type. (convert_between_encodings): Declare. (HOST_ESCAPE_CHAR): New define. (host_letter_to_control_character, host_hex_value): Declare. (enum wchar_iterate_result): New enum. (struct wchar_iterator): Declare. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): Declare. * charset-list.h: New file. * c-valprint.c (textual_name): New function. (textual_element_type): Handle wide character types. (c_val_print): Pass original type to textual_element_type. Handle wide character types. (c_value_print): Use textual_element_type. Pass original type of value to val_print. * c-lang.h (enum c_string_type): New type. (c_printchar, c_printstr): Update. * c-lang.c (classify_type): New function. (print_wchar): Likewise. (c_emit_char): Add type argument. Handle wide characters. (c_printchar): Likewise. (c_printstr): Add type argument. Handle wide and multibyte character sets. (convert_ucn): New function. (emit_numeric_character): Likewise. (convert_octal): Likewise. (convert_hex): Likewise. (ADVANCE): New macro. (convert_escape): New function. (parse_one_string): Likewise. (evaluate_subexp_c): Likewise. (exp_descriptor_c): New global. (c_language_defn): Use exp_descriptor_c. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. (charset_for_string_type): New function. * c-exp.y (%union): Add 'svec' and 'tsval'. (CHAR): New token. (exp): Add CHAR production. (string_exp): Rewrite. (exp) <string_exp>: Rewrite. (tempbuf): Now global. (tempbuf_init): New global. (parse_string_or_char): New function. (yylex) <tempbuf>: Now global. <tokptr, tempbufindex, tempbufsize, token_string, class_prefix>: Remove. Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char. (c_parse_escape): New function. * auxv.c (fprint_target_auxv): Update. * ada-valprint.c (ada_emit_char): Add type argument. (ada_printchar): Likewise. (ada_print_scalar): Update. (printstr): Add type argument. Update calls to ada_emit_char. (ada_printstr): Add type argument. (ada_val_print_array): Update. (ada_val_print_1): Likewise. * ada-lang.c (emit_char): Add type argument. * ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add type arguments. * gdb_locale.h: Include langinfo.h. * charset.c (_initialize_charset): Set default host charset from the locale. Don't register charsets. Add target-wide-charset commands. Call find_charset_names. (struct charset, struct translation): Remove. (GDB_DEFAULT_HOST_CHARSET): Remove. (GDB_DEFAULT_TARGET_WIDE_CHARSET): New define. (target_wide_charset_name): New global. (show_host_charset_name): Handle "auto". (show_target_wide_charset_name): New function. (host_charset_enum, target_charset_enum): Remove. (charset_enum): New global. (all_charsets, register_charset, lookup_charset, all_translations, register_translation, lookup_translation): Remove. (simple_charset, ascii_print_literally, ascii_to_control): Remove. (iso_8859_print_literally, iso_8859_to_control, iso_8859_family_charset): Remove. (ebcdic_print_literally, ebcdic_to_control, ebcdic_family_charset): Remove. (struct cached_iconv, check_iconv_cache, cached_iconv_convert, register_iconv_charsets): Remove. (target_wide_charset_be_name, target_wide_charset_le_name): New globals. (identity_either_char_to_other): Remove. (set_be_le_names, validate): New functions. (backslashable, backslashed, represented): Remove. (default_c_target_char_has_backslash_escape): Remove. (default_c_parse_backslash, iconv_convert): Remove. (ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table, ascii_to_ibm1047_table, iso_8859_1_to_ascii_table, iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table, ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table, ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table, ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove. (table_convert_char, table_translation, simple_table_translation): Remove. (current_host_charset, current_target_charset, c_target_char_has_backslash_escape_func, c_target_char_has_backslash_escape_baton): Remove. (c_parse_backslash_func, c_parse_backslash_baton): Remove. (host_char_to_target_func, host_char_to_target_baton): Remove. (target_char_to_host_func, target_char_to_host_baton): Remove. (cached_iconv_host_to_target, cached_iconv_target_to_host): Remove. (lookup_charset_or_error, check_valid_host_charset): Remove. (set_host_and_target_charsets): Remove. (set_host_charset, set_target_charset): Remove. (set_host_charset_sfunc, set_target_charset_sfunc): Rewrite. (set_target_wide_charset_sfunc): New function. (show_charset): Print target wide character set. (host_charset, target_charset): Rewrite. (target_wide_charset): New function. (c_target_char_has_backslash_escape): Remove. (c_parse_backslash): Remove. (host_letter_to_control_character): New function. (host_char_print_literally): Remove. (host_hex_value): New function. (target_char_to_control_char): Remove. (cleanup_iconv): New function. (convert_between_encodings): New function. (target_char_to_host): Remove. (struct wchar_iterator): Define. (make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator, wchar_push_back): New functions. (do_cleanup_iterator): New function. (char_ptr): New typedef. (charsets): New global. (add_one, find_charset_names): New functions. (default_charset_names): New global. (auto_host_charset_name): Likewise. * aclocal.m4, config.in, configure: Rebuild. * configure.ac: Call AM_LANGINFO_CODESET. (GDB_DEFAULT_HOST_CHARSET): Default to UTF-8. (AM_ICONV): Invoke earlier. * acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and LIBICONV_LIBDIR. Check for libiconv in build tree. * Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros. (INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE. (INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR. * gdb_obstack.h (obstack_grow_wstr): New define. * gdb_wchar.h: New file. * defs.h: Include it. gdb/testsuite: * gdb.base/store.exp: Update for change to escape output. * gdb.base/callfuncs.exp (fetch_all_registers): Update for change to escape output. * gdb.base/pointers.exp: Update for change to escape output. * gdb.base/long_long.exp (gdb_test_long_long): Update for change to escape output. * gdb.base/constvars.exp (do_constvar_tests): Update for change to escape output. * gdb.base/call-rt-st.exp (print_struct_call): Update for change to escape output. * gdb.cp/ref-types.exp (gdb_start_again): Update for change to escape output. * gdb.base/setvar.exp: Update for change to escape output. * lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C. * gdb.base/printcmds.exp (test_print_all_chars): Update for change to escape output. (test_print_string_constants): Likewise. * gdb.base/charset.exp (valid_host_charset): Check size of wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode cases. Handle "auto"-related output. * gdb.base/charset.c (char16_t, char32_t): New typedefs. (uvar, Uvar): New globals. gdb/doc: * gdb.texinfo (Character Sets): Remove obsolete text. Document set target-wide-charset. (Requirements): Mention iconv.
2009-03-21 00:04:40 +01:00
unk_lang_printstr (struct ui_file *stream, struct type *type,
const gdb_byte *string, unsigned int length,
2010-01-13 Phil Muldoon <pmuldoon@redhat.com> PR python/10705 * python/python-internal.h: Add lazy_string_object_type definition. (create_lazy_string_object, gdbpy_initialize_lazy_string) (gdbpy_is_lazystring, gdbpy_extract_lazy_string): Define. * python/py-value.c (valpy_lazy_string): New function. (convert_value_from_python): Add lazy string conversion. * python/py-prettyprint.c (pretty_print_one_value): Check if return is also a lazy string. (print_string_repr): Add lazy string printing branch. (print_children): Likewise. * python/py-lazy-string.c: New file. Implement lazy strings. * python/python.c (_initialize_python): Call gdbpy_initialize_lazy_string. * varobj.c (value_get_print_value): Add lazy string printing branch. Account for encoding. * c-lang.c (c_printstr): Account for new encoding argument. If encoding is NULL, find encoding suited for type, otherwise use user encoding. * language.h (language_defn): Add encoding argument. (LA_PRINT_STRING): Likewise. * language.c (unk_lang_printstr): Update to reflect new encoding argument to language_defn. * ada-lang.h (ada_printstr): Likewise. * c-lang.h (c_printstr): Likewise. * p-lang.h (pascal_printstr); * f-lang.c (f_printstr): Likewise. * m2-lang.c (m2_printstr): Likewise. * objc-lang.c (objc_printstr): Likewise. * p-lang.c (pascal_printstr): Likewise. * scm-lang.c (scm_printstr): Likewise. * c-valprint.c (c_val_print): Update LA_PRINT_STRING call for encoding argument. * ada-valprint.c (ada_printstr): Likewise. * f-valprint.c (f_val_print): Likewise * m2-valprint.c (m2_val_print): Likewise. * p-valprint.c (pascal_val_print): Likewise. * expprint.c (print_subexp_standard): Likewise. * valprint.c (val_print_string): Likewise. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-lazy-string. (SUBDIR_PYTHON_SRCS): Likewise. (py-lazy-string.o): New rule. 2010-01-13 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Values From Inferior): Document lazy_string value method. (Python API): Add Lazy strings menu item. (Lazy Strings In Python): New node. 2010-01-13 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-value.exp (test_lazy_strings): Add lazy string test. * gdb.python/py-prettyprint.py (pp_ls): New printer. * gdb.python/py-prettyprint.exp (run_lang_tests): Add lazy string test. * gdb.python/py-prettyprint.c: Define lazystring test structure. * gdb.python/py-mi.exp: Add lazy string test.
2010-01-14 09:03:37 +01:00
const char *encoding, int force_ellipses,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
const struct value_print_options *options)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_printstr called."));
}
static void
unk_lang_print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_print_type called."));
}
static void
unk_lang_val_print (struct type *type, const gdb_byte *valaddr,
2005-01-29 02:59:31 +01:00
int embedded_offset, CORE_ADDR address,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
struct ui_file *stream, int recurse,
gdb PR gdb/9977, PR exp/11636: * value.h (value_offset): Update. (struct lval_funcs) <check_validity>: New field. <copy_closure>: Make argument const. (value_computed_closure): Update. (value_contents_for_printing): Declare. (value_bits_valid): Likewise. (val_print): Likewise. (set_value_component_location): Update. (value_entirely_optimized_out): Declare. * value.c (value_offset): Argument now const. (require_not_optimized_out): New function. (value_contents_for_printing): New function. (value_contents_all): Call require_not_optimized_out. (value_contents): Likewise. (value_bits_valid): New function. (value_computed_closure): Argument now const. (set_value_component_location): Make 'whole' argument const. (value_entirely_optimized_out): New function. (value_bitsize): Argument now 'const'. (value_bitpos): Likewise. (value_type): Likewise. * valprint.h (val_print_array_elements): Update. * valprint.c (val_print): Add 'val' argument. Use valprint_check_validity. (valprint_check_validity): New function. (value_check_printable): Use value_entirely_optimized_out. (common_val_print): Update. (value_print): Likewise. (val_print_array_elements): Add 'val' argument. * valops.c (value_fetch_lazy): Use value_contents_for_printing, value_bits_valid. Reinit frame cache for lval_computed. * sh64-tdep.c (sh64_do_register): Update. * scm-valprint.c (scm_val_print): Add 'val' argument. * scm-lang.h (scm_val_print): Update. * python/python.h (apply_val_pretty_printer): Update. * python/py-prettyprint.c (apply_val_pretty_printer): Add 'val' argument. Call set_value_component_location. * printcmd.c (print_scalar_formatted): Update. * p-valprint.c (pascal_val_print): Add 'val' argument. (pascal_object_print_value_fields): Likewise. (pascal_object_print_value): Likewise. (pascal_object_print_static_field): Update. * p-lang.h (pascal_val_print): Update. (pascal_object_print_value_fields): Update. * mt-tdep.c (mt_registers_info): Update. * mi/mi-main.c (get_register): Update. (mi_cmd_data_evaluate_expression): Use common_val_print. * m2-valprint.c (m2_print_array_contents): Add 'val' argument. (m2_print_unbounded_array): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * language.h (struct language_defn) <la_val_print>: Add 'val' argument. (LA_VAL_PRINT): Likewise. * language.c (unk_lang_val_print): Add 'val' argument. * jv-valprint.c (java_print_value_fields): Add 'val' argument. (java_val_print): Likewise. * jv-lang.h (java_val_print): Add 'val' argument. * infcmd.c (default_print_registers_info): Update. * f-valprint.c (f77_print_array_1): Add 'val' argument. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Add 'val' argument. * dwarf2loc.c (read_pieced_value): Use value_bitsize and value_bitpos. <DWARF_VALUE_OPTIMIZED_OUT>: Don't print warning. Call set_value_optimized_out. (write_pieced_value): Use value_bitsize and value_bitpos. <default>: Don't exit loop. (check_pieced_value_validity): New function. (pieced_value_funcs): Reference check_pieced_value_validity, check_pieced_value_invalid. (copy_pieced_value_closure): Update. (check_pieced_value_bits): New function. (check_pieced_value_invalid): New function. * d-valprint.c (dynamic_array_type): Add 'val' argument. (d_val_print): Likewise. * d-lang.h (d_val_print): Update. * cp-valprint.c (cp_print_value_fields): Add 'val' argument. (cp_print_value_fields_rtti): Likewise. (cp_print_value): Likewise. (cp_print_static_field): Update. * c-valprint.c (c_val_print): Add 'val' argument. (c_value_print): Update. * c-lang.h (c_val_print): Update. (cp_print_value_fields): Likewise. (cp_print_value_fields_rtti): Likewise. * ada-valprint.c (struct ada_val_print_args): Remove. (val_print_packed_array_elements): Add 'val' argument. (ada_val_print): Likewise. Rewrite. (ada_val_print_stub): Remove. (ada_val_print_array): Add 'val' argument. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Update. (print_record): Add 'val' argument. (print_field_values): Likewise. * ada-lang.h (ada_val_print): Update. gdb/testsuite PR gdb/9977, PR exp/11636:: * gdb.dwarf2/pieces.exp (pieces_test_f3): Remove kfail. (pieces_test_f6): Update expected output.
2010-06-11 17:36:10 +02:00
const struct value *val,
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
const struct value_print_options *options)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_val_print called."));
}
static void
gdb * varobj.c (value_get_print_value): Include valprint.h. (value_get_print_value): Use get_formatted_print_options. * value.h (struct value_print_options): Declare. (value_print, val_print, common_val_print, val_print_string): Update. * value.c: Include valprint.h. (show_values): Use get_user_print_options. (show_convenience): Likewise. * valprint.h (prettyprint_arrays, prettyprint_structs): Don't declare. (struct value_print_options): New type. (vtblprint, unionprint, addressprint, objectprint, print_max, inspect_it, repeat_count_threshold, output_format, stop_print_at_null): Don't declare. (user_print_options, get_user_print_options, get_raw_print_options, get_formatted_print_options): Declare. (print_array_indexes_p): Don't declare. (maybe_print_array_index, val_print_array_elements): Update. * valprint.c (print_max): Remove. (user_print_options): New global. (get_user_print_options, get_raw_print_options, get_formatted_print_options): New functions. (print_array_indexes, repeat_count_threshold, stop_print_at_null, prettyprint_structs, prettyprint_arrays, unionprint, addressprint): Remove. (val_print): Remove format, deref_ref, pretty arguments; add options. Update. (common_val_print): Likewise. (print_array_indexes_p): Remove. (maybe_print_array_index): Remove format, pretty arguments; add options. Update. (val_print_array_elements): Remove format, deref_ref, pretty arguments; add options. Update. (val_print_string): Add options argument. Update. (_initialize_valprint): Use user_print_options. (output_format): Remove. (set_output_radix_1): Use user_print_options. * typeprint.c: Include valprint.h. (objectprint): Don't declare. (whatis_exp): Use get_user_print_options. * tui/tui-regs.c: Include valprint.h. (tui_register_format): Use get_formatted_print_options. * tracepoint.c: Include valprint.h. (addressprint): Don't declare. (trace_mention): Use get_user_print_options. (tracepoints_info): Likewise. * stack.c (print_frame_args): Use get_raw_print_options. (print_frame_info): Use get_user_print_options. (print_frame): Likewise. * sh64-tdep.c: Include valprint.h (sh64_do_register): Use get_formatted_print_options. * scm-valprint.c (scm_inferior_print): Remove format, deref_ref, pretty arguments; add options. (scm_scmlist_print): Likewise. Update. (scm_scmval_print): Likewise. (scm_val_print): Likewise. (scm_value_print): Remove format, pretty arguments; add options. Update. * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print): Update. * scm-lang.c (scm_printstr): Add options argument. * python/python-value.c: Include valprint.h. (valpy_str): Use get_user_print_options. * printcmd.c: Include valprint.h. (addressprint): Don't declare. (inspect_it): Remove. (print_formatted): Remove format option; add options. Update. (print_scalar_formatted): Likewise. (print_address_demangle): Use get_user_print_options. (do_examine): Use get_formatted_print_options. (print_command_1): Likewise. (output_command): Use get_formatted_print_options. (do_one_display): Likewise. (print_variable_value): Use get_user_print_options. * p-valprint.c (pascal_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (pascal_value_print): Remove format, pretty arguments; add options. Update. (vtblprint, objectprint): Don't declare. (pascal_static_field_print): Remove. (pascal_object_print_value_fields): Remove format, pretty arguments; add options. Update. (pascal_object_print_static_field): Likewise. (_initialize_pascal_valprint): Use user_print_options. Update. * p-lang.h (pascal_val_print, pascal_value_print, pascal_printstr, pascal_object_print_value_fields): Update. (vtblprint, static_field_print): Don't declare. * p-lang.c (pascal_printstr): Add options argument. Update. * objc-lang.c (objc_printstr): Add options argument. Update. * mt-tdep.c: Include valprint.h. (mt_registers_info): Use get_raw_print_options. * mips-tdep.c: Include valprint.h. (mips_print_fp_register): Use get_formatted_print_options. (mips_print_register): Likewise. * mi/mi-main.c: Include valprint.h. (get_register): Use get_user_print_options. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Use get_formatted_print_options. * mi/mi-cmd-stack.c: Include valprint.h. (list_args_or_locals): Use get_raw_print_options. * m2-valprint.c (print_function_pointer_address): Add addressprint argument. (m2_print_long_set): Remove format, pretty arguments. (m2_print_unbounded_array): Remove format, deref_ref, pretty arguments; add options. Update. (print_unpacked_pointer): Remove format argument; add options. Now static. Update. (print_variable_at_address): Remove format, deref_ref, pretty arguments; add options. Update. (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * m2-lang.c (m2_printstr): Add options argument. Update. * language.h (struct value_print_options): Declare. (struct language_defn) <la_printstr>: Add options argument. <la_val_print>: Remove format, deref_ref, pretty argument; add options. <la_value_print>: Remove format, pretty arguments; add options. <la_print_array_index>: Likewise. (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING, LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Update. * language.c (default_print_array_index): Remove format, pretty arguments; add options. Update. (unk_lang_printstr): Add options argument. (unk_lang_val_print): Remove format, deref_ref, pretty arguments; add options. (unk_lang_value_print): Remove format, pretty arguments; add options. * jv-valprint.c (java_value_print): Remove format, pretty arguments; add options. Update. (java_print_value_fields): Likewise. (java_val_print): Remove format, deref_ref, pretty arguments; add options. Update. * jv-lang.h (java_val_print, java_value_print): Declare. * infcmd.c: Include valprint.h. (print_return_value): Use get_raw_print_options. (default_print_registers_info): Use get_user_print_options, get_formatted_print_options. (registers_info): Use get_formatted_print_options. * gdbtypes.h (struct value_print_options): Declare. (print_scalar_formatted): Update. * f-valprint.c (f77_print_array_1): Remove format, deref_ref, pretty arguments; add options. Update. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Update. * f-lang.c (f_printstr): Add options argument. Update. (c_value_print): Update declaration. * expprint.c: Include valprint.h. (print_subexp_standard): Use get_raw_print_options, get_user_print_options. * eval.c: Include valprint.h. (objectprint): Don't declare. (evaluate_subexp_standard): Use get_user_print_options. * cp-valprint.c (vtblprint, objectprint, static_field_print): Remove. (cp_print_value_fields): Remove format, pretty arguments; add options. Update. (cp_print_value): Likewise. (cp_print_static_field): Likewise. (_initialize_cp_valprint): Use user_print_options. Update. * c-valprint.c (print_function_pointer_address): Add addressprint argument. (c_val_print): Remove format, deref_ref, pretty arguments; add options. Update. (c_value_print): Add options argument. Update. * c-lang.h (c_val_print, c_value_print, c_printstr): Update. (vtblprint, static_field_print): Don't declare. (cp_print_value_fields): Update. * c-lang.c (c_printstr): Add options argument. Update. * breakpoint.c: Include valprint.h. (addressprint): Don't declare. (watchpoint_value_print): Use get_user_print_options. (print_one_breakpoint_location): Likewise. (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention, print_exception_catchpoint): Likewise. * auxv.c (fprint_target_auxv): Don't declare addressprint. Use get_user_print_options. * ada-valprint.c (struct ada_val_print_args): Remove format, deref_ref, and pretty; add options. (print_optional_low_bound): Add options argument. (val_print_packed_array_elements): Remove format and pretty arguments; add options. Update. (printstr): Add options argument. Update. (ada_printstr): Likewise. (ada_val_print): Remove format, deref_ref, pretty arguments; add options argument. Update. (ada_val_print_stub): Update. (ada_val_print_array): Remove format, deref_ref, pretty arguments; add options. Update. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Remove format, pretty arguments; add options. Update. (print_record): Likewise. (print_field_values): Likewise. * ada-lang.h (ada_val_print, ada_value_print, ada_printstr): Update. * ada-lang.c (ada_print_array_index): Add options argument; remove format and pretty arguments. (print_one_exception): Use get_user_print_options. gdb/testsuite * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
2008-10-28 18:19:58 +01:00
unk_lang_value_print (struct value *val, struct ui_file *stream,
const struct value_print_options *options)
{
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
error (_("internal error - unimplemented "
"function unk_lang_value_print called."));
}
* gdbarch.sh (skip_trampoline_code): Add FRAME argument. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (generic_skip_trampoline_code): Add FRAME argument. * arch-utils.h (generic_skip_trampoline_code): Likewise. * infrun.c (handle_inferior_event): Pass current frame to gdbarch_skip_trampoline_code and skip_language_trampoline. * language.c (unk_lang_trampoline): Add FRAME argument. (skip_language_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * language.h: Add forward declaration of struct frame_info. (struct language_defn): Add FRAME argument to skip_trampoline. (skip_language_trampoline): Add FRAME argument. * cp-abi.c (cplus_skip_trampoline): Add FRAME argument. Pass it to skip_trampoline callback. * cp-abi.h: Add forward declaration of struct frame_info. (cplus_skip_trampoline): Add FRAME argument. (struct cp_abi_ops): Add FRAME argument to skip_trampoline callback. * gnu-v3-abi.c (gnuv3_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * objc-lang.c (objc_skip_trampoline): Add FRAME argument. Pass it to gdbarch_skip_trampoline_code. * minsyms.c (find_solib_trampoline_target): Add FRAME argument. * symtab.h (find_solib_trampoline_target): Likewise. * obsd-tdep.c (obsd_skip_solib_resolver): Pass current frame to find_solib_trampoline_target. * arm-tdep.c (arm_skip_stub): Add FRAME argument. Read registers from FRAME instead of calling read_register. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_register. * hppa-tdep.c (hppa_skip_trampoline_code): Likewise. * hppa-tdep.h (hppa_skip_trampoline_code): Add FRAME argument. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Add FRAME argument. * m32c-tdep.c (m32c_skip_trampoline_code): Add FRAME argument. * mips-tdep.c (mips_skip_trampoline_code): Add FRAME argument. Read registers from FRAME instead of using read_signed_register. * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Add FRAME argument. (ppc64_standard_linkage_target): Likewise. Read registers from FRAME instead of using read_register. (ppc64_skip_trampoline_code): Add FRAME argument. Pass it to ppc64_standard_linkage_target. * rs6000-tdep.c (rs6000_skip_trampoline_code): Add FRAME argument. Pass it to find_solib_trampoline_target. Read registers from FRAME instead of using read_register. * xstormy16-tdep.c (xstormy16_skip_trampoline_code): Add FRAME argument.
2007-06-16 00:39:52 +02:00
static CORE_ADDR unk_lang_trampoline (struct frame_info *frame, CORE_ADDR pc)
{
return 0;
}
/* Unknown languages just use the cplus demangler. */
static char *unk_lang_demangle (const char *mangled, int options)
{
return cplus_demangle (mangled, options);
}
static char *unk_lang_class_name (const char *mangled)
{
return NULL;
}
1999-07-07 22:19:36 +02:00
static const struct op_print unk_op_print_tab[] =
{
{NULL, OP_NULL, PREC_NULL, 0}
};
static void
unknown_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
lai->string_char_type = builtin_type (gdbarch)->builtin_char;
* language.h (struct language_arch_info): New members bool_type_default and bool_type_symbol. (lang_bool_type): Remove prototype. (LA_BOOL_TYPE): Remove macro. (language_bool_type): Add prototype. * language.c (lang_bool_type): Remove. (language_bool_type): New function. * value.h (value_in): Change return value to int. * value.c (value_in): Return int instead of struct value *. * eval.c (evaluate_subexp_standard): Call language_bool_type instead of using LA_BOOL_TYPE. Update call to value_in. * ada-lang.c (ada_evaluate_subexp): Call language_bool_type instead of using LA_BOOL_TYPE or builtin_type_int for boolean values. * language.c (unknown_language_arch_info): Set bool_type_default member of struct language_arch_info. * ada-lang.c (ada_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * c-lang.c (c_language_arch_info): Set bool_type_default member of struct language_arch_info. (cplus_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * f-lang.c (f_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * jv-lang.c (java_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * m2-lang.c (m2_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * p-lang.c (p_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info.
2008-09-11 16:11:40 +02:00
lai->bool_type_default = builtin_type (gdbarch)->builtin_int;
lai->primitive_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1,
struct type *);
}
1999-07-07 22:19:36 +02:00
const struct language_defn unknown_language_defn =
{
"unknown",
language_unknown,
range_check_off,
type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
* parser-defs.h (struct exp_descriptor): New definition, containing language-specific info for printing, prefixifying, dumping, and evaluating expressions. (exp_descriptor_standard): Declare new variable. (print_subexp): Make global and declare here (from expprint.c). (dump_subexp): Ditto. (dump_subexp_body_standard): Declare. (operator_length_standard): Declare. (op_name_standard): Declare. (print_subexp): Declare. (print_subexp_standard): Declare. * language.h (struct language_defn): Add la_exp_desc field to hold pointer to table for language-specific operators. Remove evaluate_exp field, which is now in struct exp_descriptor. * parse.c (operator_length): Move most code to new operator_length_standard function. Use language-specific information. (operator_length_standard): New function taking most code from operator_length. (exp_descriptor_standard): New constant. * expression.h (enum exp_opcode): Add definitions of OP_EXTENDED0 and OP_EXTENDED_LAST. * expprint.c (print_subexp): Use language-specific print_subexp. Make global; remove static declaration. Move most code to print_subexp_standard. (print_subexp_standard): New function, containing code formerly in print_subexp. (op_name): Add expression to argument signature. Use langauge-specific op_name. Move most code to op_name_standard. (op_name_standard): New function, containing code formerly in op_name. (dump_subexp): Use new version of op_name function. Use language-specific dump_subexp_body, and move most existing code to dump_subexp_body_standard. (dump_raw_expression): Use new op_name interface. (dump_subexp_body): Move most code to dump_subexp_body_standard. (dump_subexp_body_standard): New function, containing code formerly in dump_subexp_body. * language.c (unknown_language): Add default la_exp_desc field and remove evaluate_exp field. (auto_language): Ditto. (local_language): Ditto. * f-lang.c (f_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * jv-lang.c (exp_descriptor_java): New variable, containing Java-specific expression evaluator. (java_language_defn): Add la_exp_desc field and remove evaluate_exp field. * scm-lang.c (exp_descriptor_scm): New variable, containing Scheme-specific expression evaluator. (scm_language_defn): Add la_exp_desc field and remove evaluate_exp field. * objc-lang.c (print_object_command): Take evaluate_exp from the la_exp_desc field. * Makefile.in (eval.o): Add dependency on parser-defs.h. * eval.c: Include parser-defs.h for the full declaration of la_exp_desc's type. (evaluate_subexp): Get evaluate_exp out of la_exp_desc field.
2003-09-25 10:40:45 +02:00
&exp_descriptor_standard,
unk_lang_parser,
unk_lang_error,
null_post_parser,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
unk_lang_emit_char,
unk_lang_print_type, /* Print a type using appropriate syntax */
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
language-specific read_var_value for Ada renamings The purpose of this patch is to better support renamings in the "info locals" command. Consider ... procedure Foo is GV : Integer renames Pck.Global_Variable; begin Increment (GV); -- STOP end Foo; ... Pck.Global_Variable is just an integer. After having stopped at the "STOP" line, "info locals" yields: (gdb) info locals gv = <error reading variable gv (Cannot access memory at address 0xffffffffffffffff)> In reality, two things are happening: (1) Variable "GV" does not exist, which is normal, since there is "GV" the renaming of another variable; (2) But to allow the user access to that renaming the same way the code has, the compiler produces an artificial variable whose name encodes the renaming: gv___XR_pck__global_variable___XE For practical reasons, the artificial variable itself is given irrelevant types and addresses. But the "info locals" command does not act as if it was a short-cut of "foreach VAR in locals, print VAR". Instead it gets the value of each VAR directly, which does not work in this case, since the variable is artificial and needs to be decoded first. This patch makes the "read_var_value" routine language-specific. The old implementation of "read_var_value" gets renamed to "default_read_var_value" and all languages now use it (unchanged behavior), except for Ada. In Ada, the new function ada_read_var_value checks if we have a renaming, and if so, evaluates its value, or else defers to default_read_var_value. gdb/ChangeLog: * language.h (struct language_defn): New "method" la_read_var_value. * findvar.c: #include "language.h". (default_read_var_value): Renames read_var_value. Rewrite function description. (read_var_value): New function. * value.h (default_read_var_value): Add prototype. * ada-lang.c (ada_read_renaming_var_value, ada_read_var_value): New functions. (ada_language_defn): Add entry for la_read_var_value. * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, language.c, * m2-lang.c, objc-lang.c, opencl-lang.c, p-lang.c: Update language_defn structures to add entry for new la_read_var_value field.
2012-03-02 20:29:01 +01:00
default_read_var_value, /* la_read_var_value */
unk_lang_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
2004-01-23 David Carlton <carlton@kealia.com> Partial workaround for PR c++/1511: * cp-namespace.c: Include frame.h. (cp_lookup_transparent_type): New (cp_lookup_transparent_type_loop): New. * cp-support.h: Declare cp_lookup_transparent_type. * symtab.c (basic_lookup_transparent_type): Renamed from lookup_transparent_type. (lookup_transparent_type): Replace old body by a call to current_language->la_lookup_transparent_type. * symtab.h: Update copyright. Declare basic_lookup_transparent_type. * language.h: Update copyright. (struct language_defn): Add la_lookup_transparent_type. * language.c: Update copyright. (unknown_language_defn): Add basic_lookup_transparent_type. (auto_language_defn): Add basic_lookup_transparent_type. (local_language_defn): Add basic_lookup_transparent_type. * ada-lang.c: Update copyright. (ada_language_defn): Add basic_lookup_transparent_type. * c-lang.c: Update copyright. (c_language_defn): Add basic_lookup_transparent_type. (cplus_language_defn): Add basic_lookup_transparent_type. (asm_language_defn): Add basic_lookup_transparent_type. (minimal_language_defn): Add basic_lookup_transparent_type. * f-lang.c: Update copyright. (f_language_defn): Add basic_lookup_transparent_type. * jv-lang.c: Update copyright. (java_language_defn): Add basic_lookup_transparent_type. * m2-lang.c: Update copyright. (m2_language_defn): Add basic_lookup_transparent_type. * objc-lang.c: Update copyright. (objc_language_defn): Add basic_lookup_transparent_type. * p-lang.c: Update copyright. (p_language_defn): Add basic_lookup_transparent_type. * scm-lang.c: Update copyright. (scm_language_defn): Add basic_lookup_transparent_type. * Makefile.in (cp-namespace.o): Depend on frame.h. 2004-01-23 David Carlton <carlton@kealia.com> * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add test for cp_lookup_transparent_type. * gdb.cp/rtti1.cc: Update copyright. Add n2::func and refer_to; call them.
2004-01-24 00:03:31 +01:00
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
unk_lang_class_name, /* Language specific
class_name_from_physname */
unk_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
default_make_symbol_completion_list,
unknown_language_arch_info, /* la_language_arch_info. */
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_cmp */
the "ambiguous linespec" series gdb 2011-12-06 Joel Brobecker <brobecker@acacore.com> * language.h (struct language_defn): Add new component la_symbol_name_compare. * symfile.h (struct quick_symbol_functions): Update the profile of parameter "name_matcher" for the expand_symtabs_matching method. Update the documentation accordingly. * ada-lang.h (ada_name_for_lookup): Add declaration. * ada-lang.c (ada_name_for_lookup): New function, extracted out from ada_iterate_over_symbols. (ada_iterate_over_symbols): Do not encode symbol name anymore. (ada_expand_partial_symbol_name): Adjust profile. (ada_language_defn): Add value for la_symbol_name_compare field. * linespec.c: #include "ada-lang.h". (iterate_name_matcher): Add language parameter. Replace call to strcmp_iw by call to language->la_symbol_name_compare. (decode_variable): Encode COPY if current language is Ada. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile of name_matcher parameter. Adjust call to name_matcher. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (expand_partial_symbol_names): Update profile of parameter "fun". * psymtab.h (expand_partial_symbol_names): Update profile of parameter "fun". * symtab.c (demangle_for_lookup): Update function documentation. (search_symbols_name_matches): Add language parameter. (expand_partial_symbol_name): Likewise. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Add value for la_symbol_name_compare field. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * opencl-lang.c (opencl_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Ditto. 2011-12-06 Tom Tromey <tromey@redhat.com> * linespec.c (iterate_over_all_matching_symtabs): Use LA_ITERATE_OVER_SYMBOLS. (lookup_prefix_sym, add_matching_symbols_to_info): Likewise. (find_function_symbols, decode_variable): Remove Ada special case. * language.h (struct language_defn) <la_iterate_over_symbols>: New field. (LA_ITERATE_OVER_SYMBOLS): New macro. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * d-lang.c (d_language_defn): Update. * f-lang.c (f_language_defn): Update. * jv-lang.c (java_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * ada-lang.c (ada_iterate_over_symbols): New function. (ada_language_defn): Update. 2011-12-06 Tom Tromey <tromey@redhat.com> Joel Brobecker <brobecker@acacore.com> PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366, PR objc/8535, PR breakpoints/11657, PR breakpoints/11970, PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856, PR shlibs/8929, PR shlibs/7393: * python/py-type.c (compare_maybe_null_strings): Rename from compare_strings. (check_types_equal): Update. * utils.c (compare_strings): New function. * tui/tui-winsource.c (tui_update_breakpoint_info): Update for location changes. * tracepoint.c (scope_info): Update. (trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE. * symtab.h (iterate_over_minimal_symbols) (iterate_over_some_symtabs, iterate_over_symtabs) (find_pcs_for_symtab_line, iterate_over_symbols) (demangle_for_lookup): Declare. (expand_line_sal): Remove. * symtab.c (iterate_over_some_symtabs, iterate_over_symtabs) (lookup_symtab_callback): New functions. (lookup_symtab): Rewrite. (demangle_for_lookup): New function, extract from lookup_symbol_in_language. (lookup_symbol_in_language): Use it. (iterate_over_symbols): New function. (find_line_symtab): Update. (find_pcs_for_symtab_line): New functions. (find_line_common): Add 'start' argument. (decode_line_spec): Update. Change argument to 'flags', change interpretation. (append_expanded_sal): Remove. (append_exact_match_to_sals): Remove. (expand_line_sal): Remove. * symfile.h (struct quick_symbol_functions) <lookup_symtab>: Remove. <map_symtabs_matching_filename>: New field. * stack.c (func_command): Only look in the current program space. Use DECODE_LINE_FUNFIRSTLINE. * source.c (line_info): Set pspace on sal. Check program space in the loop. Use DECODE_LINE_LIST_MODE. (select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE. * solib-target.c: Remove DEF_VEC_I(CORE_ADDR). * python/python.c (gdbpy_decode_line): Update. * psymtab.c (partial_map_expand_apply): New function. (partial_map_symtabs_matching_filename): Rename from lookup_partial_symbol. Update arguments. (lookup_symtab_via_partial_symtab): Remove. (psym_functions): Update. * objc-lang.h (parse_selector, parse_method): Don't declare. (find_imps): Update. * objc-lang.c (parse_selector, parse_method): Now static. (find_methods): Change arguments. Fill in a vector of symbol names. (uniquify_strings): New function. (find_imps): Change arguments. * minsyms.c (iterate_over_minimal_symbols): New function. * linespec.h (enum decode_line_flags): New. (struct linespec_sals): New. (struct linespec_result) <canonical>: Remove. <pre_expanded, addr_string, sals>: New fields. (destroy_linespec_result, make_cleanup_destroy_linespec_result) (decode_line_full): Declare. (decode_line_1): Update. * linespec.c (struct address_entry, struct linespec_state, struct collect_info): New types. (add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry) (eq_address_entry, maybe_add_address): New functions. (total_number_of_methods): Remove. (iterate_name_matcher, iterate_over_all_matching_symtabs): New functions. (find_methods): Change arguments. Don't canonicalize input. Simplify logic. (add_matching_methods, add_constructors) (build_canonical_line_spec): Remove. (filter_results, convert_results_to_lsals): New functions. (decode_line_2): Change arguments. Rewrite for new data structures. (decode_line_internal): Rename from decode_line_1. Change arguments. Add cleanups. Update for new data structures. (linespec_state_constructor, linespec_state_destructor) (decode_line_full, decode_line_1): New functions. (decode_indirect): Change arguments. Update. (locate_first_half): Use skip_spaces. (decode_objc): Change arguments. Update for new data structures. Simplify logic. (decode_compound): Change arguments. Add cleanups. Remove fallback code, replace with error. (struct decode_compound_collector): New type. (collect_one_symbol): New function. (lookup_prefix_sym): Change arguments. Update. (compare_symbol_name, add_all_symbol_names_from_pspace) (find_superclass_methods ): New functions. (find_method): Rewrite. (struct symtab_collector): New type. (add_symtabs_to_list, collect_symtabs_from_filename): New functions. (symtabs_from_filename): Change API. Rename from symtab_from_filename. (collect_function_symbols): New function. (find_function_symbols): Change API. Rename from find_function_symbol. Rewrite. (decode_all_digits): Change arguments. Rewrite. (decode_dollar): Change arguments. Use decode_variable. (decode_label): Change arguments. Rewrite. (collect_symbols): New function. (minsym_found): Change arguments. Rewrite. (check_minsym, search_minsyms_for_name) (add_matching_symbols_to_info): New function. (decode_variable): Change arguments. Iterate over all symbols. (symbol_found): Remove. (symbol_to_sal): New function. (init_linespec_result, destroy_linespec_result) (cleanup_linespec_result, make_cleanup_destroy_linespec_result): New functions. (decode_digits_list_mode, decode_digits_ordinary): New functions. * dwarf2read.c (dw2_map_expand_apply): New function. (dw2_map_symtabs_matching_filename): Rename from dw2_lookup_symtab. Change arguments. (dwarf2_gdb_index_functions): Update. * dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR). * defs.h (compare_strings): Declare. * cli/cli-cmds.c (compare_strings): Move to utils.c. (edit_command, list_command): Use DECODE_LINE_LIST_MODE. Call filter_sals. (compare_symtabs, filter_sals): New functions. * breakpoint.h (struct bp_location) <line_number, source_file>: New fields. (struct breakpoint) <line_number, source_file>: Remove. <filter>: New field. * breakpoint.c (print_breakpoint_location, init_raw_breakpoint) (momentary_breakpoint_from_master, add_location_to_breakpoint): Update for changes to locations. (init_breakpoint_sal): Add 'filter' argument. Set 'filter' on breakpoint. (create_breakpoint_sal): Add 'filter' argument. (remove_sal, expand_line_sal_maybe): Remove. (create_breakpoints_sal): Remove 'sals' argument. Handle pre-expanded sals and the filter. (parse_breakpoint_sals): Use decode_line_full. (check_fast_tracepoint_sals): Use get_sal_arch. (create_breakpoint): Create a linespec_sals. Update. (break_range_command): Use decode_line_full. Update. (until_break_command): Update. (clear_command): Update match conditions for linespec.c changes. Use DECODE_LINE_LIST_MODE. (say_where): Update for changes to locations. (bp_location_dtor): Free 'source_file'. (base_breakpoint_dtor): Free 'filter'. Don't free 'source_file'. (update_static_tracepoint): Update for changes to locations. (update_breakpoint_locations): Disable ranged breakpoint if too many locations match. Update. (addr_string_to_sals): Use decode_line_full. Resolve all sal PCs. (breakpoint_re_set_default): Don't call expand_line_sal_maybe. (decode_line_spec_1): Update. Change argument name to 'flags', change interpretation. * block.h (block_containing_function): Declare. * block.c (block_containing_function): New function. * skip.c (skip_function_command): Update. (skip_re_set): Update. * infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE. * mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE. * NEWS: Add entry. 2011-12-06 Tom Tromey <tromey@redhat.com> * elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow breakpoint's pspace to be NULL. * breakpoint.h (struct breakpoint) <pspace>: Update comment. * breakpoint.c (init_raw_breakpoint): Conditionally set breakpoint's pspace. (init_breakpoint_sal): Don't set breakpoint's pspace. (prepare_re_set_context): Conditionally switch program space. (addr_string_to_sals): Check executing_startup on location's program space. 2011-12-06 Tom Tromey <tromey@redhat.com> * breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove. * breakpoint.c (should_be_inserted): Explicitly check if program space is executing startup. (describe_other_breakpoints): Update. (disable_breakpoints_before_startup): Change executing_startup earlier. Remove loop. (enable_breakpoints_after_startup): Likewise. (init_breakpoint_sal): Don't use bp_startup_disabled. (create_breakpoint): Don't use bp_startup_disabled. (update_global_location_list): Use should_be_inserted. (bkpt_re_set): Update. gdb/testsuite 2011-12-06 Joel Brobecker <brobecker@acacore.com> * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs involving a fully qualified function name. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.ada/homonym.exp: Add three breakpoint tests. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.base/solib-weak.exp (do_test): Remove kfail. * gdb.trace/tracecmd.exp: Disable pending breakpoints earlier. * gdb.objc/objcdecode.exp: Update for output changes. * gdb.linespec/linespec.exp: New file. * gdb.linespec/lspec.cc: New file. * gdb.linespec/lspec.h: New file. * gdb.linespec/body.h: New file. * gdb.linespec/base/two/thefile.cc: New file. * gdb.linespec/base/one/thefile.cc: New file. * gdb.linespec/Makefile.in: New file. * gdb.cp/templates.exp (test_template_breakpoints): Update for output changes. * gdb.cp/re-set-overloaded.exp: Remove kfail. * gdb.cp/ovldbreak.exp: Update for output changes. "all" test now makes one breakpoint. * gdb.cp/method2.exp (test_break): Update for output changes. * gdb.cp/mb-templates.exp: Update for output changes. * gdb.cp/mb-inline.exp: Update for output changes. * gdb.cp/mb-ctor.exp: Update for output changes. * gdb.cp/ovsrch.exp: Use fully-qualified names. * gdb.base/solib-symbol.exp: Run to main later. Breakpoint now has multiple matches. * gdb.base/sepdebug.exp: Disable pending breakpoints. Update for error message change. * gdb.base/list.exp (test_list_filename_and_number): Update for error message change. * gdb.base/break.exp: Disable pending breakpoints. Update for output changes. * configure.ac: Add gdb.linespec. * configure: Rebuild. * Makefile.in (ALL_SUBDIRS): Add gdb.linespec. gdb/doc 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 19:54:43 +01:00
iterate_over_symbols,
LANG_MAGIC
};
/* These two structs define fake entries for the "local" and "auto"
options. */
1999-07-07 22:19:36 +02:00
const struct language_defn auto_language_defn =
{
"auto",
language_auto,
range_check_off,
type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
* parser-defs.h (struct exp_descriptor): New definition, containing language-specific info for printing, prefixifying, dumping, and evaluating expressions. (exp_descriptor_standard): Declare new variable. (print_subexp): Make global and declare here (from expprint.c). (dump_subexp): Ditto. (dump_subexp_body_standard): Declare. (operator_length_standard): Declare. (op_name_standard): Declare. (print_subexp): Declare. (print_subexp_standard): Declare. * language.h (struct language_defn): Add la_exp_desc field to hold pointer to table for language-specific operators. Remove evaluate_exp field, which is now in struct exp_descriptor. * parse.c (operator_length): Move most code to new operator_length_standard function. Use language-specific information. (operator_length_standard): New function taking most code from operator_length. (exp_descriptor_standard): New constant. * expression.h (enum exp_opcode): Add definitions of OP_EXTENDED0 and OP_EXTENDED_LAST. * expprint.c (print_subexp): Use language-specific print_subexp. Make global; remove static declaration. Move most code to print_subexp_standard. (print_subexp_standard): New function, containing code formerly in print_subexp. (op_name): Add expression to argument signature. Use langauge-specific op_name. Move most code to op_name_standard. (op_name_standard): New function, containing code formerly in op_name. (dump_subexp): Use new version of op_name function. Use language-specific dump_subexp_body, and move most existing code to dump_subexp_body_standard. (dump_raw_expression): Use new op_name interface. (dump_subexp_body): Move most code to dump_subexp_body_standard. (dump_subexp_body_standard): New function, containing code formerly in dump_subexp_body. * language.c (unknown_language): Add default la_exp_desc field and remove evaluate_exp field. (auto_language): Ditto. (local_language): Ditto. * f-lang.c (f_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * jv-lang.c (exp_descriptor_java): New variable, containing Java-specific expression evaluator. (java_language_defn): Add la_exp_desc field and remove evaluate_exp field. * scm-lang.c (exp_descriptor_scm): New variable, containing Scheme-specific expression evaluator. (scm_language_defn): Add la_exp_desc field and remove evaluate_exp field. * objc-lang.c (print_object_command): Take evaluate_exp from the la_exp_desc field. * Makefile.in (eval.o): Add dependency on parser-defs.h. * eval.c: Include parser-defs.h for the full declaration of la_exp_desc's type. (evaluate_subexp): Get evaluate_exp out of la_exp_desc field.
2003-09-25 10:40:45 +02:00
&exp_descriptor_standard,
unk_lang_parser,
unk_lang_error,
null_post_parser,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
unk_lang_emit_char,
unk_lang_print_type, /* Print a type using appropriate syntax */
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
language-specific read_var_value for Ada renamings The purpose of this patch is to better support renamings in the "info locals" command. Consider ... procedure Foo is GV : Integer renames Pck.Global_Variable; begin Increment (GV); -- STOP end Foo; ... Pck.Global_Variable is just an integer. After having stopped at the "STOP" line, "info locals" yields: (gdb) info locals gv = <error reading variable gv (Cannot access memory at address 0xffffffffffffffff)> In reality, two things are happening: (1) Variable "GV" does not exist, which is normal, since there is "GV" the renaming of another variable; (2) But to allow the user access to that renaming the same way the code has, the compiler produces an artificial variable whose name encodes the renaming: gv___XR_pck__global_variable___XE For practical reasons, the artificial variable itself is given irrelevant types and addresses. But the "info locals" command does not act as if it was a short-cut of "foreach VAR in locals, print VAR". Instead it gets the value of each VAR directly, which does not work in this case, since the variable is artificial and needs to be decoded first. This patch makes the "read_var_value" routine language-specific. The old implementation of "read_var_value" gets renamed to "default_read_var_value" and all languages now use it (unchanged behavior), except for Ada. In Ada, the new function ada_read_var_value checks if we have a renaming, and if so, evaluates its value, or else defers to default_read_var_value. gdb/ChangeLog: * language.h (struct language_defn): New "method" la_read_var_value. * findvar.c: #include "language.h". (default_read_var_value): Renames read_var_value. Rewrite function description. (read_var_value): New function. * value.h (default_read_var_value): Add prototype. * ada-lang.c (ada_read_renaming_var_value, ada_read_var_value): New functions. (ada_language_defn): Add entry for la_read_var_value. * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, language.c, * m2-lang.c, objc-lang.c, opencl-lang.c, p-lang.c: Update language_defn structures to add entry for new la_read_var_value field.
2012-03-02 20:29:01 +01:00
default_read_var_value, /* la_read_var_value */
unk_lang_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
2004-01-23 David Carlton <carlton@kealia.com> Partial workaround for PR c++/1511: * cp-namespace.c: Include frame.h. (cp_lookup_transparent_type): New (cp_lookup_transparent_type_loop): New. * cp-support.h: Declare cp_lookup_transparent_type. * symtab.c (basic_lookup_transparent_type): Renamed from lookup_transparent_type. (lookup_transparent_type): Replace old body by a call to current_language->la_lookup_transparent_type. * symtab.h: Update copyright. Declare basic_lookup_transparent_type. * language.h: Update copyright. (struct language_defn): Add la_lookup_transparent_type. * language.c: Update copyright. (unknown_language_defn): Add basic_lookup_transparent_type. (auto_language_defn): Add basic_lookup_transparent_type. (local_language_defn): Add basic_lookup_transparent_type. * ada-lang.c: Update copyright. (ada_language_defn): Add basic_lookup_transparent_type. * c-lang.c: Update copyright. (c_language_defn): Add basic_lookup_transparent_type. (cplus_language_defn): Add basic_lookup_transparent_type. (asm_language_defn): Add basic_lookup_transparent_type. (minimal_language_defn): Add basic_lookup_transparent_type. * f-lang.c: Update copyright. (f_language_defn): Add basic_lookup_transparent_type. * jv-lang.c: Update copyright. (java_language_defn): Add basic_lookup_transparent_type. * m2-lang.c: Update copyright. (m2_language_defn): Add basic_lookup_transparent_type. * objc-lang.c: Update copyright. (objc_language_defn): Add basic_lookup_transparent_type. * p-lang.c: Update copyright. (p_language_defn): Add basic_lookup_transparent_type. * scm-lang.c: Update copyright. (scm_language_defn): Add basic_lookup_transparent_type. * Makefile.in (cp-namespace.o): Depend on frame.h. 2004-01-23 David Carlton <carlton@kealia.com> * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add test for cp_lookup_transparent_type. * gdb.cp/rtti1.cc: Update copyright. Add n2::func and refer_to; call them.
2004-01-24 00:03:31 +01:00
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
unk_lang_class_name, /* Language specific
class_name_from_physname */
unk_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
default_make_symbol_completion_list,
unknown_language_arch_info, /* la_language_arch_info. */
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_cmp */
the "ambiguous linespec" series gdb 2011-12-06 Joel Brobecker <brobecker@acacore.com> * language.h (struct language_defn): Add new component la_symbol_name_compare. * symfile.h (struct quick_symbol_functions): Update the profile of parameter "name_matcher" for the expand_symtabs_matching method. Update the documentation accordingly. * ada-lang.h (ada_name_for_lookup): Add declaration. * ada-lang.c (ada_name_for_lookup): New function, extracted out from ada_iterate_over_symbols. (ada_iterate_over_symbols): Do not encode symbol name anymore. (ada_expand_partial_symbol_name): Adjust profile. (ada_language_defn): Add value for la_symbol_name_compare field. * linespec.c: #include "ada-lang.h". (iterate_name_matcher): Add language parameter. Replace call to strcmp_iw by call to language->la_symbol_name_compare. (decode_variable): Encode COPY if current language is Ada. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile of name_matcher parameter. Adjust call to name_matcher. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (expand_partial_symbol_names): Update profile of parameter "fun". * psymtab.h (expand_partial_symbol_names): Update profile of parameter "fun". * symtab.c (demangle_for_lookup): Update function documentation. (search_symbols_name_matches): Add language parameter. (expand_partial_symbol_name): Likewise. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Add value for la_symbol_name_compare field. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * opencl-lang.c (opencl_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Ditto. 2011-12-06 Tom Tromey <tromey@redhat.com> * linespec.c (iterate_over_all_matching_symtabs): Use LA_ITERATE_OVER_SYMBOLS. (lookup_prefix_sym, add_matching_symbols_to_info): Likewise. (find_function_symbols, decode_variable): Remove Ada special case. * language.h (struct language_defn) <la_iterate_over_symbols>: New field. (LA_ITERATE_OVER_SYMBOLS): New macro. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * d-lang.c (d_language_defn): Update. * f-lang.c (f_language_defn): Update. * jv-lang.c (java_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * ada-lang.c (ada_iterate_over_symbols): New function. (ada_language_defn): Update. 2011-12-06 Tom Tromey <tromey@redhat.com> Joel Brobecker <brobecker@acacore.com> PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366, PR objc/8535, PR breakpoints/11657, PR breakpoints/11970, PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856, PR shlibs/8929, PR shlibs/7393: * python/py-type.c (compare_maybe_null_strings): Rename from compare_strings. (check_types_equal): Update. * utils.c (compare_strings): New function. * tui/tui-winsource.c (tui_update_breakpoint_info): Update for location changes. * tracepoint.c (scope_info): Update. (trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE. * symtab.h (iterate_over_minimal_symbols) (iterate_over_some_symtabs, iterate_over_symtabs) (find_pcs_for_symtab_line, iterate_over_symbols) (demangle_for_lookup): Declare. (expand_line_sal): Remove. * symtab.c (iterate_over_some_symtabs, iterate_over_symtabs) (lookup_symtab_callback): New functions. (lookup_symtab): Rewrite. (demangle_for_lookup): New function, extract from lookup_symbol_in_language. (lookup_symbol_in_language): Use it. (iterate_over_symbols): New function. (find_line_symtab): Update. (find_pcs_for_symtab_line): New functions. (find_line_common): Add 'start' argument. (decode_line_spec): Update. Change argument to 'flags', change interpretation. (append_expanded_sal): Remove. (append_exact_match_to_sals): Remove. (expand_line_sal): Remove. * symfile.h (struct quick_symbol_functions) <lookup_symtab>: Remove. <map_symtabs_matching_filename>: New field. * stack.c (func_command): Only look in the current program space. Use DECODE_LINE_FUNFIRSTLINE. * source.c (line_info): Set pspace on sal. Check program space in the loop. Use DECODE_LINE_LIST_MODE. (select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE. * solib-target.c: Remove DEF_VEC_I(CORE_ADDR). * python/python.c (gdbpy_decode_line): Update. * psymtab.c (partial_map_expand_apply): New function. (partial_map_symtabs_matching_filename): Rename from lookup_partial_symbol. Update arguments. (lookup_symtab_via_partial_symtab): Remove. (psym_functions): Update. * objc-lang.h (parse_selector, parse_method): Don't declare. (find_imps): Update. * objc-lang.c (parse_selector, parse_method): Now static. (find_methods): Change arguments. Fill in a vector of symbol names. (uniquify_strings): New function. (find_imps): Change arguments. * minsyms.c (iterate_over_minimal_symbols): New function. * linespec.h (enum decode_line_flags): New. (struct linespec_sals): New. (struct linespec_result) <canonical>: Remove. <pre_expanded, addr_string, sals>: New fields. (destroy_linespec_result, make_cleanup_destroy_linespec_result) (decode_line_full): Declare. (decode_line_1): Update. * linespec.c (struct address_entry, struct linespec_state, struct collect_info): New types. (add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry) (eq_address_entry, maybe_add_address): New functions. (total_number_of_methods): Remove. (iterate_name_matcher, iterate_over_all_matching_symtabs): New functions. (find_methods): Change arguments. Don't canonicalize input. Simplify logic. (add_matching_methods, add_constructors) (build_canonical_line_spec): Remove. (filter_results, convert_results_to_lsals): New functions. (decode_line_2): Change arguments. Rewrite for new data structures. (decode_line_internal): Rename from decode_line_1. Change arguments. Add cleanups. Update for new data structures. (linespec_state_constructor, linespec_state_destructor) (decode_line_full, decode_line_1): New functions. (decode_indirect): Change arguments. Update. (locate_first_half): Use skip_spaces. (decode_objc): Change arguments. Update for new data structures. Simplify logic. (decode_compound): Change arguments. Add cleanups. Remove fallback code, replace with error. (struct decode_compound_collector): New type. (collect_one_symbol): New function. (lookup_prefix_sym): Change arguments. Update. (compare_symbol_name, add_all_symbol_names_from_pspace) (find_superclass_methods ): New functions. (find_method): Rewrite. (struct symtab_collector): New type. (add_symtabs_to_list, collect_symtabs_from_filename): New functions. (symtabs_from_filename): Change API. Rename from symtab_from_filename. (collect_function_symbols): New function. (find_function_symbols): Change API. Rename from find_function_symbol. Rewrite. (decode_all_digits): Change arguments. Rewrite. (decode_dollar): Change arguments. Use decode_variable. (decode_label): Change arguments. Rewrite. (collect_symbols): New function. (minsym_found): Change arguments. Rewrite. (check_minsym, search_minsyms_for_name) (add_matching_symbols_to_info): New function. (decode_variable): Change arguments. Iterate over all symbols. (symbol_found): Remove. (symbol_to_sal): New function. (init_linespec_result, destroy_linespec_result) (cleanup_linespec_result, make_cleanup_destroy_linespec_result): New functions. (decode_digits_list_mode, decode_digits_ordinary): New functions. * dwarf2read.c (dw2_map_expand_apply): New function. (dw2_map_symtabs_matching_filename): Rename from dw2_lookup_symtab. Change arguments. (dwarf2_gdb_index_functions): Update. * dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR). * defs.h (compare_strings): Declare. * cli/cli-cmds.c (compare_strings): Move to utils.c. (edit_command, list_command): Use DECODE_LINE_LIST_MODE. Call filter_sals. (compare_symtabs, filter_sals): New functions. * breakpoint.h (struct bp_location) <line_number, source_file>: New fields. (struct breakpoint) <line_number, source_file>: Remove. <filter>: New field. * breakpoint.c (print_breakpoint_location, init_raw_breakpoint) (momentary_breakpoint_from_master, add_location_to_breakpoint): Update for changes to locations. (init_breakpoint_sal): Add 'filter' argument. Set 'filter' on breakpoint. (create_breakpoint_sal): Add 'filter' argument. (remove_sal, expand_line_sal_maybe): Remove. (create_breakpoints_sal): Remove 'sals' argument. Handle pre-expanded sals and the filter. (parse_breakpoint_sals): Use decode_line_full. (check_fast_tracepoint_sals): Use get_sal_arch. (create_breakpoint): Create a linespec_sals. Update. (break_range_command): Use decode_line_full. Update. (until_break_command): Update. (clear_command): Update match conditions for linespec.c changes. Use DECODE_LINE_LIST_MODE. (say_where): Update for changes to locations. (bp_location_dtor): Free 'source_file'. (base_breakpoint_dtor): Free 'filter'. Don't free 'source_file'. (update_static_tracepoint): Update for changes to locations. (update_breakpoint_locations): Disable ranged breakpoint if too many locations match. Update. (addr_string_to_sals): Use decode_line_full. Resolve all sal PCs. (breakpoint_re_set_default): Don't call expand_line_sal_maybe. (decode_line_spec_1): Update. Change argument name to 'flags', change interpretation. * block.h (block_containing_function): Declare. * block.c (block_containing_function): New function. * skip.c (skip_function_command): Update. (skip_re_set): Update. * infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE. * mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE. * NEWS: Add entry. 2011-12-06 Tom Tromey <tromey@redhat.com> * elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow breakpoint's pspace to be NULL. * breakpoint.h (struct breakpoint) <pspace>: Update comment. * breakpoint.c (init_raw_breakpoint): Conditionally set breakpoint's pspace. (init_breakpoint_sal): Don't set breakpoint's pspace. (prepare_re_set_context): Conditionally switch program space. (addr_string_to_sals): Check executing_startup on location's program space. 2011-12-06 Tom Tromey <tromey@redhat.com> * breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove. * breakpoint.c (should_be_inserted): Explicitly check if program space is executing startup. (describe_other_breakpoints): Update. (disable_breakpoints_before_startup): Change executing_startup earlier. Remove loop. (enable_breakpoints_after_startup): Likewise. (init_breakpoint_sal): Don't use bp_startup_disabled. (create_breakpoint): Don't use bp_startup_disabled. (update_global_location_list): Use should_be_inserted. (bkpt_re_set): Update. gdb/testsuite 2011-12-06 Joel Brobecker <brobecker@acacore.com> * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs involving a fully qualified function name. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.ada/homonym.exp: Add three breakpoint tests. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.base/solib-weak.exp (do_test): Remove kfail. * gdb.trace/tracecmd.exp: Disable pending breakpoints earlier. * gdb.objc/objcdecode.exp: Update for output changes. * gdb.linespec/linespec.exp: New file. * gdb.linespec/lspec.cc: New file. * gdb.linespec/lspec.h: New file. * gdb.linespec/body.h: New file. * gdb.linespec/base/two/thefile.cc: New file. * gdb.linespec/base/one/thefile.cc: New file. * gdb.linespec/Makefile.in: New file. * gdb.cp/templates.exp (test_template_breakpoints): Update for output changes. * gdb.cp/re-set-overloaded.exp: Remove kfail. * gdb.cp/ovldbreak.exp: Update for output changes. "all" test now makes one breakpoint. * gdb.cp/method2.exp (test_break): Update for output changes. * gdb.cp/mb-templates.exp: Update for output changes. * gdb.cp/mb-inline.exp: Update for output changes. * gdb.cp/mb-ctor.exp: Update for output changes. * gdb.cp/ovsrch.exp: Use fully-qualified names. * gdb.base/solib-symbol.exp: Run to main later. Breakpoint now has multiple matches. * gdb.base/sepdebug.exp: Disable pending breakpoints. Update for error message change. * gdb.base/list.exp (test_list_filename_and_number): Update for error message change. * gdb.base/break.exp: Disable pending breakpoints. Update for output changes. * configure.ac: Add gdb.linespec. * configure: Rebuild. * Makefile.in (ALL_SUBDIRS): Add gdb.linespec. gdb/doc 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 19:54:43 +01:00
iterate_over_symbols,
LANG_MAGIC
};
1999-07-07 22:19:36 +02:00
const struct language_defn local_language_defn =
{
"local",
language_auto,
range_check_off,
type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
* parser-defs.h (struct exp_descriptor): New definition, containing language-specific info for printing, prefixifying, dumping, and evaluating expressions. (exp_descriptor_standard): Declare new variable. (print_subexp): Make global and declare here (from expprint.c). (dump_subexp): Ditto. (dump_subexp_body_standard): Declare. (operator_length_standard): Declare. (op_name_standard): Declare. (print_subexp): Declare. (print_subexp_standard): Declare. * language.h (struct language_defn): Add la_exp_desc field to hold pointer to table for language-specific operators. Remove evaluate_exp field, which is now in struct exp_descriptor. * parse.c (operator_length): Move most code to new operator_length_standard function. Use language-specific information. (operator_length_standard): New function taking most code from operator_length. (exp_descriptor_standard): New constant. * expression.h (enum exp_opcode): Add definitions of OP_EXTENDED0 and OP_EXTENDED_LAST. * expprint.c (print_subexp): Use language-specific print_subexp. Make global; remove static declaration. Move most code to print_subexp_standard. (print_subexp_standard): New function, containing code formerly in print_subexp. (op_name): Add expression to argument signature. Use langauge-specific op_name. Move most code to op_name_standard. (op_name_standard): New function, containing code formerly in op_name. (dump_subexp): Use new version of op_name function. Use language-specific dump_subexp_body, and move most existing code to dump_subexp_body_standard. (dump_raw_expression): Use new op_name interface. (dump_subexp_body): Move most code to dump_subexp_body_standard. (dump_subexp_body_standard): New function, containing code formerly in dump_subexp_body. * language.c (unknown_language): Add default la_exp_desc field and remove evaluate_exp field. (auto_language): Ditto. (local_language): Ditto. * f-lang.c (f_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * jv-lang.c (exp_descriptor_java): New variable, containing Java-specific expression evaluator. (java_language_defn): Add la_exp_desc field and remove evaluate_exp field. * scm-lang.c (exp_descriptor_scm): New variable, containing Scheme-specific expression evaluator. (scm_language_defn): Add la_exp_desc field and remove evaluate_exp field. * objc-lang.c (print_object_command): Take evaluate_exp from the la_exp_desc field. * Makefile.in (eval.o): Add dependency on parser-defs.h. * eval.c: Include parser-defs.h for the full declaration of la_exp_desc's type. (evaluate_subexp): Get evaluate_exp out of la_exp_desc field.
2003-09-25 10:40:45 +02:00
&exp_descriptor_standard,
unk_lang_parser,
unk_lang_error,
null_post_parser,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
unk_lang_emit_char,
unk_lang_print_type, /* Print a type using appropriate syntax */
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
language-specific read_var_value for Ada renamings The purpose of this patch is to better support renamings in the "info locals" command. Consider ... procedure Foo is GV : Integer renames Pck.Global_Variable; begin Increment (GV); -- STOP end Foo; ... Pck.Global_Variable is just an integer. After having stopped at the "STOP" line, "info locals" yields: (gdb) info locals gv = <error reading variable gv (Cannot access memory at address 0xffffffffffffffff)> In reality, two things are happening: (1) Variable "GV" does not exist, which is normal, since there is "GV" the renaming of another variable; (2) But to allow the user access to that renaming the same way the code has, the compiler produces an artificial variable whose name encodes the renaming: gv___XR_pck__global_variable___XE For practical reasons, the artificial variable itself is given irrelevant types and addresses. But the "info locals" command does not act as if it was a short-cut of "foreach VAR in locals, print VAR". Instead it gets the value of each VAR directly, which does not work in this case, since the variable is artificial and needs to be decoded first. This patch makes the "read_var_value" routine language-specific. The old implementation of "read_var_value" gets renamed to "default_read_var_value" and all languages now use it (unchanged behavior), except for Ada. In Ada, the new function ada_read_var_value checks if we have a renaming, and if so, evaluates its value, or else defers to default_read_var_value. gdb/ChangeLog: * language.h (struct language_defn): New "method" la_read_var_value. * findvar.c: #include "language.h". (default_read_var_value): Renames read_var_value. Rewrite function description. (read_var_value): New function. * value.h (default_read_var_value): Add prototype. * ada-lang.c (ada_read_renaming_var_value, ada_read_var_value): New functions. (ada_language_defn): Add entry for la_read_var_value. * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, language.c, * m2-lang.c, objc-lang.c, opencl-lang.c, p-lang.c: Update language_defn structures to add entry for new la_read_var_value field.
2012-03-02 20:29:01 +01:00
default_read_var_value, /* la_read_var_value */
unk_lang_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
2004-01-23 David Carlton <carlton@kealia.com> Partial workaround for PR c++/1511: * cp-namespace.c: Include frame.h. (cp_lookup_transparent_type): New (cp_lookup_transparent_type_loop): New. * cp-support.h: Declare cp_lookup_transparent_type. * symtab.c (basic_lookup_transparent_type): Renamed from lookup_transparent_type. (lookup_transparent_type): Replace old body by a call to current_language->la_lookup_transparent_type. * symtab.h: Update copyright. Declare basic_lookup_transparent_type. * language.h: Update copyright. (struct language_defn): Add la_lookup_transparent_type. * language.c: Update copyright. (unknown_language_defn): Add basic_lookup_transparent_type. (auto_language_defn): Add basic_lookup_transparent_type. (local_language_defn): Add basic_lookup_transparent_type. * ada-lang.c: Update copyright. (ada_language_defn): Add basic_lookup_transparent_type. * c-lang.c: Update copyright. (c_language_defn): Add basic_lookup_transparent_type. (cplus_language_defn): Add basic_lookup_transparent_type. (asm_language_defn): Add basic_lookup_transparent_type. (minimal_language_defn): Add basic_lookup_transparent_type. * f-lang.c: Update copyright. (f_language_defn): Add basic_lookup_transparent_type. * jv-lang.c: Update copyright. (java_language_defn): Add basic_lookup_transparent_type. * m2-lang.c: Update copyright. (m2_language_defn): Add basic_lookup_transparent_type. * objc-lang.c: Update copyright. (objc_language_defn): Add basic_lookup_transparent_type. * p-lang.c: Update copyright. (p_language_defn): Add basic_lookup_transparent_type. * scm-lang.c: Update copyright. (scm_language_defn): Add basic_lookup_transparent_type. * Makefile.in (cp-namespace.o): Depend on frame.h. 2004-01-23 David Carlton <carlton@kealia.com> * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add test for cp_lookup_transparent_type. * gdb.cp/rtti1.cc: Update copyright. Add n2::func and refer_to; call them.
2004-01-24 00:03:31 +01:00
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
unk_lang_class_name, /* Language specific
class_name_from_physname */
unk_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
default_make_symbol_completion_list,
unknown_language_arch_info, /* la_language_arch_info. */
2005-10-03 Joel Brobecker <brobecker@adacore.com> * language.h (language_defn): New field la_print_array_index. (LA_PRINT_ARRAY_INDEX): New macro. (default_print_array_index): Add declaration. * language.c (default_print_array_index): new function. (unknown_language): Add value for new field. (auto_language): Likewise. (local_language): Likewise. * ada-lang.c (ada_print_array_index): New function. (ada_language_defn): Add value for new field. * c-lang.c (c_language_defn): Likewise. (cpluc_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * jv-lang.c (java_language_defn): Likewise. * m2-lang.c (m2_language_defn): Likewise. * objc-lang.c (objc_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * scm-lang.c (scm_language_defn): Likewise. * valprint.h (print_array_indexes_p): Add declaration. (get_array_low_bound): Add declaration. (maybe_print_array_index): Add declaration. * valprint.c (print_array_indexes): New static variable. (show_print_array_indexes): New function. (print_array_indexes_p): New function. (get_array_low_bound): New function. (maybe_print_array_index): New function. (val_print_array_elements): Print the index of each element if requested by the user. (_initialize_valprint): Add new array-indexes "set/show print" command. * ada-valprint.c (print_optional_low_bound): Replace extracted code by call to ada_get_array_low_bound_and_type(). Stop printing the low bound if indexes will be printed for all elements of the array. (val_print_packed_array_elements): Print the index of each element of the array if necessary.
2005-10-03 23:21:20 +02:00
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_cmp */
the "ambiguous linespec" series gdb 2011-12-06 Joel Brobecker <brobecker@acacore.com> * language.h (struct language_defn): Add new component la_symbol_name_compare. * symfile.h (struct quick_symbol_functions): Update the profile of parameter "name_matcher" for the expand_symtabs_matching method. Update the documentation accordingly. * ada-lang.h (ada_name_for_lookup): Add declaration. * ada-lang.c (ada_name_for_lookup): New function, extracted out from ada_iterate_over_symbols. (ada_iterate_over_symbols): Do not encode symbol name anymore. (ada_expand_partial_symbol_name): Adjust profile. (ada_language_defn): Add value for la_symbol_name_compare field. * linespec.c: #include "ada-lang.h". (iterate_name_matcher): Add language parameter. Replace call to strcmp_iw by call to language->la_symbol_name_compare. (decode_variable): Encode COPY if current language is Ada. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile of name_matcher parameter. Adjust call to name_matcher. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (expand_partial_symbol_names): Update profile of parameter "fun". * psymtab.h (expand_partial_symbol_names): Update profile of parameter "fun". * symtab.c (demangle_for_lookup): Update function documentation. (search_symbols_name_matches): Add language parameter. (expand_partial_symbol_name): Likewise. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Add value for la_symbol_name_compare field. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * opencl-lang.c (opencl_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Ditto. 2011-12-06 Tom Tromey <tromey@redhat.com> * linespec.c (iterate_over_all_matching_symtabs): Use LA_ITERATE_OVER_SYMBOLS. (lookup_prefix_sym, add_matching_symbols_to_info): Likewise. (find_function_symbols, decode_variable): Remove Ada special case. * language.h (struct language_defn) <la_iterate_over_symbols>: New field. (LA_ITERATE_OVER_SYMBOLS): New macro. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * d-lang.c (d_language_defn): Update. * f-lang.c (f_language_defn): Update. * jv-lang.c (java_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * ada-lang.c (ada_iterate_over_symbols): New function. (ada_language_defn): Update. 2011-12-06 Tom Tromey <tromey@redhat.com> Joel Brobecker <brobecker@acacore.com> PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366, PR objc/8535, PR breakpoints/11657, PR breakpoints/11970, PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856, PR shlibs/8929, PR shlibs/7393: * python/py-type.c (compare_maybe_null_strings): Rename from compare_strings. (check_types_equal): Update. * utils.c (compare_strings): New function. * tui/tui-winsource.c (tui_update_breakpoint_info): Update for location changes. * tracepoint.c (scope_info): Update. (trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE. * symtab.h (iterate_over_minimal_symbols) (iterate_over_some_symtabs, iterate_over_symtabs) (find_pcs_for_symtab_line, iterate_over_symbols) (demangle_for_lookup): Declare. (expand_line_sal): Remove. * symtab.c (iterate_over_some_symtabs, iterate_over_symtabs) (lookup_symtab_callback): New functions. (lookup_symtab): Rewrite. (demangle_for_lookup): New function, extract from lookup_symbol_in_language. (lookup_symbol_in_language): Use it. (iterate_over_symbols): New function. (find_line_symtab): Update. (find_pcs_for_symtab_line): New functions. (find_line_common): Add 'start' argument. (decode_line_spec): Update. Change argument to 'flags', change interpretation. (append_expanded_sal): Remove. (append_exact_match_to_sals): Remove. (expand_line_sal): Remove. * symfile.h (struct quick_symbol_functions) <lookup_symtab>: Remove. <map_symtabs_matching_filename>: New field. * stack.c (func_command): Only look in the current program space. Use DECODE_LINE_FUNFIRSTLINE. * source.c (line_info): Set pspace on sal. Check program space in the loop. Use DECODE_LINE_LIST_MODE. (select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE. * solib-target.c: Remove DEF_VEC_I(CORE_ADDR). * python/python.c (gdbpy_decode_line): Update. * psymtab.c (partial_map_expand_apply): New function. (partial_map_symtabs_matching_filename): Rename from lookup_partial_symbol. Update arguments. (lookup_symtab_via_partial_symtab): Remove. (psym_functions): Update. * objc-lang.h (parse_selector, parse_method): Don't declare. (find_imps): Update. * objc-lang.c (parse_selector, parse_method): Now static. (find_methods): Change arguments. Fill in a vector of symbol names. (uniquify_strings): New function. (find_imps): Change arguments. * minsyms.c (iterate_over_minimal_symbols): New function. * linespec.h (enum decode_line_flags): New. (struct linespec_sals): New. (struct linespec_result) <canonical>: Remove. <pre_expanded, addr_string, sals>: New fields. (destroy_linespec_result, make_cleanup_destroy_linespec_result) (decode_line_full): Declare. (decode_line_1): Update. * linespec.c (struct address_entry, struct linespec_state, struct collect_info): New types. (add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry) (eq_address_entry, maybe_add_address): New functions. (total_number_of_methods): Remove. (iterate_name_matcher, iterate_over_all_matching_symtabs): New functions. (find_methods): Change arguments. Don't canonicalize input. Simplify logic. (add_matching_methods, add_constructors) (build_canonical_line_spec): Remove. (filter_results, convert_results_to_lsals): New functions. (decode_line_2): Change arguments. Rewrite for new data structures. (decode_line_internal): Rename from decode_line_1. Change arguments. Add cleanups. Update for new data structures. (linespec_state_constructor, linespec_state_destructor) (decode_line_full, decode_line_1): New functions. (decode_indirect): Change arguments. Update. (locate_first_half): Use skip_spaces. (decode_objc): Change arguments. Update for new data structures. Simplify logic. (decode_compound): Change arguments. Add cleanups. Remove fallback code, replace with error. (struct decode_compound_collector): New type. (collect_one_symbol): New function. (lookup_prefix_sym): Change arguments. Update. (compare_symbol_name, add_all_symbol_names_from_pspace) (find_superclass_methods ): New functions. (find_method): Rewrite. (struct symtab_collector): New type. (add_symtabs_to_list, collect_symtabs_from_filename): New functions. (symtabs_from_filename): Change API. Rename from symtab_from_filename. (collect_function_symbols): New function. (find_function_symbols): Change API. Rename from find_function_symbol. Rewrite. (decode_all_digits): Change arguments. Rewrite. (decode_dollar): Change arguments. Use decode_variable. (decode_label): Change arguments. Rewrite. (collect_symbols): New function. (minsym_found): Change arguments. Rewrite. (check_minsym, search_minsyms_for_name) (add_matching_symbols_to_info): New function. (decode_variable): Change arguments. Iterate over all symbols. (symbol_found): Remove. (symbol_to_sal): New function. (init_linespec_result, destroy_linespec_result) (cleanup_linespec_result, make_cleanup_destroy_linespec_result): New functions. (decode_digits_list_mode, decode_digits_ordinary): New functions. * dwarf2read.c (dw2_map_expand_apply): New function. (dw2_map_symtabs_matching_filename): Rename from dw2_lookup_symtab. Change arguments. (dwarf2_gdb_index_functions): Update. * dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR). * defs.h (compare_strings): Declare. * cli/cli-cmds.c (compare_strings): Move to utils.c. (edit_command, list_command): Use DECODE_LINE_LIST_MODE. Call filter_sals. (compare_symtabs, filter_sals): New functions. * breakpoint.h (struct bp_location) <line_number, source_file>: New fields. (struct breakpoint) <line_number, source_file>: Remove. <filter>: New field. * breakpoint.c (print_breakpoint_location, init_raw_breakpoint) (momentary_breakpoint_from_master, add_location_to_breakpoint): Update for changes to locations. (init_breakpoint_sal): Add 'filter' argument. Set 'filter' on breakpoint. (create_breakpoint_sal): Add 'filter' argument. (remove_sal, expand_line_sal_maybe): Remove. (create_breakpoints_sal): Remove 'sals' argument. Handle pre-expanded sals and the filter. (parse_breakpoint_sals): Use decode_line_full. (check_fast_tracepoint_sals): Use get_sal_arch. (create_breakpoint): Create a linespec_sals. Update. (break_range_command): Use decode_line_full. Update. (until_break_command): Update. (clear_command): Update match conditions for linespec.c changes. Use DECODE_LINE_LIST_MODE. (say_where): Update for changes to locations. (bp_location_dtor): Free 'source_file'. (base_breakpoint_dtor): Free 'filter'. Don't free 'source_file'. (update_static_tracepoint): Update for changes to locations. (update_breakpoint_locations): Disable ranged breakpoint if too many locations match. Update. (addr_string_to_sals): Use decode_line_full. Resolve all sal PCs. (breakpoint_re_set_default): Don't call expand_line_sal_maybe. (decode_line_spec_1): Update. Change argument name to 'flags', change interpretation. * block.h (block_containing_function): Declare. * block.c (block_containing_function): New function. * skip.c (skip_function_command): Update. (skip_re_set): Update. * infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE. * mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE. * NEWS: Add entry. 2011-12-06 Tom Tromey <tromey@redhat.com> * elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow breakpoint's pspace to be NULL. * breakpoint.h (struct breakpoint) <pspace>: Update comment. * breakpoint.c (init_raw_breakpoint): Conditionally set breakpoint's pspace. (init_breakpoint_sal): Don't set breakpoint's pspace. (prepare_re_set_context): Conditionally switch program space. (addr_string_to_sals): Check executing_startup on location's program space. 2011-12-06 Tom Tromey <tromey@redhat.com> * breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove. * breakpoint.c (should_be_inserted): Explicitly check if program space is executing startup. (describe_other_breakpoints): Update. (disable_breakpoints_before_startup): Change executing_startup earlier. Remove loop. (enable_breakpoints_after_startup): Likewise. (init_breakpoint_sal): Don't use bp_startup_disabled. (create_breakpoint): Don't use bp_startup_disabled. (update_global_location_list): Use should_be_inserted. (bkpt_re_set): Update. gdb/testsuite 2011-12-06 Joel Brobecker <brobecker@acacore.com> * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs involving a fully qualified function name. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.ada/homonym.exp: Add three breakpoint tests. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.base/solib-weak.exp (do_test): Remove kfail. * gdb.trace/tracecmd.exp: Disable pending breakpoints earlier. * gdb.objc/objcdecode.exp: Update for output changes. * gdb.linespec/linespec.exp: New file. * gdb.linespec/lspec.cc: New file. * gdb.linespec/lspec.h: New file. * gdb.linespec/body.h: New file. * gdb.linespec/base/two/thefile.cc: New file. * gdb.linespec/base/one/thefile.cc: New file. * gdb.linespec/Makefile.in: New file. * gdb.cp/templates.exp (test_template_breakpoints): Update for output changes. * gdb.cp/re-set-overloaded.exp: Remove kfail. * gdb.cp/ovldbreak.exp: Update for output changes. "all" test now makes one breakpoint. * gdb.cp/method2.exp (test_break): Update for output changes. * gdb.cp/mb-templates.exp: Update for output changes. * gdb.cp/mb-inline.exp: Update for output changes. * gdb.cp/mb-ctor.exp: Update for output changes. * gdb.cp/ovsrch.exp: Use fully-qualified names. * gdb.base/solib-symbol.exp: Run to main later. Breakpoint now has multiple matches. * gdb.base/sepdebug.exp: Disable pending breakpoints. Update for error message change. * gdb.base/list.exp (test_list_filename_and_number): Update for error message change. * gdb.base/break.exp: Disable pending breakpoints. Update for output changes. * configure.ac: Add gdb.linespec. * configure: Rebuild. * Makefile.in (ALL_SUBDIRS): Add gdb.linespec. gdb/doc 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 19:54:43 +01:00
iterate_over_symbols,
LANG_MAGIC
};
/* Per-architecture language information. */
static struct gdbarch_data *language_gdbarch_data;
struct language_gdbarch
{
/* A vector of per-language per-architecture info. Indexed by "enum
language". */
struct language_arch_info arch_info[nr_languages];
};
static void *
language_gdbarch_post_init (struct gdbarch *gdbarch)
{
struct language_gdbarch *l;
int i;
l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch);
for (i = 0; i < languages_size; i++)
{
if (languages[i] != NULL
&& languages[i]->la_language_arch_info != NULL)
languages[i]->la_language_arch_info
(gdbarch, l->arch_info + languages[i]->la_language);
}
return l;
}
struct type *
language_string_char_type (const struct language_defn *la,
struct gdbarch *gdbarch)
{
struct language_gdbarch *ld = gdbarch_data (gdbarch,
language_gdbarch_data);
return ld->arch_info[la->la_language].string_char_type;
}
* language.h (struct language_arch_info): New members bool_type_default and bool_type_symbol. (lang_bool_type): Remove prototype. (LA_BOOL_TYPE): Remove macro. (language_bool_type): Add prototype. * language.c (lang_bool_type): Remove. (language_bool_type): New function. * value.h (value_in): Change return value to int. * value.c (value_in): Return int instead of struct value *. * eval.c (evaluate_subexp_standard): Call language_bool_type instead of using LA_BOOL_TYPE. Update call to value_in. * ada-lang.c (ada_evaluate_subexp): Call language_bool_type instead of using LA_BOOL_TYPE or builtin_type_int for boolean values. * language.c (unknown_language_arch_info): Set bool_type_default member of struct language_arch_info. * ada-lang.c (ada_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * c-lang.c (c_language_arch_info): Set bool_type_default member of struct language_arch_info. (cplus_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * f-lang.c (f_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * jv-lang.c (java_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * m2-lang.c (m2_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * p-lang.c (p_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info.
2008-09-11 16:11:40 +02:00
struct type *
language_bool_type (const struct language_defn *la,
struct gdbarch *gdbarch)
{
struct language_gdbarch *ld = gdbarch_data (gdbarch,
language_gdbarch_data);
if (ld->arch_info[la->la_language].bool_type_symbol)
{
struct symbol *sym;
* language.h (struct language_arch_info): New members bool_type_default and bool_type_symbol. (lang_bool_type): Remove prototype. (LA_BOOL_TYPE): Remove macro. (language_bool_type): Add prototype. * language.c (lang_bool_type): Remove. (language_bool_type): New function. * value.h (value_in): Change return value to int. * value.c (value_in): Return int instead of struct value *. * eval.c (evaluate_subexp_standard): Call language_bool_type instead of using LA_BOOL_TYPE. Update call to value_in. * ada-lang.c (ada_evaluate_subexp): Call language_bool_type instead of using LA_BOOL_TYPE or builtin_type_int for boolean values. * language.c (unknown_language_arch_info): Set bool_type_default member of struct language_arch_info. * ada-lang.c (ada_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * c-lang.c (c_language_arch_info): Set bool_type_default member of struct language_arch_info. (cplus_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * f-lang.c (f_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * jv-lang.c (java_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * m2-lang.c (m2_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * p-lang.c (p_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info.
2008-09-11 16:11:40 +02:00
sym = lookup_symbol (ld->arch_info[la->la_language].bool_type_symbol,
NULL, VAR_DOMAIN, NULL);
if (sym)
{
struct type *type = SYMBOL_TYPE (sym);
* language.h (struct language_arch_info): New members bool_type_default and bool_type_symbol. (lang_bool_type): Remove prototype. (LA_BOOL_TYPE): Remove macro. (language_bool_type): Add prototype. * language.c (lang_bool_type): Remove. (language_bool_type): New function. * value.h (value_in): Change return value to int. * value.c (value_in): Return int instead of struct value *. * eval.c (evaluate_subexp_standard): Call language_bool_type instead of using LA_BOOL_TYPE. Update call to value_in. * ada-lang.c (ada_evaluate_subexp): Call language_bool_type instead of using LA_BOOL_TYPE or builtin_type_int for boolean values. * language.c (unknown_language_arch_info): Set bool_type_default member of struct language_arch_info. * ada-lang.c (ada_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * c-lang.c (c_language_arch_info): Set bool_type_default member of struct language_arch_info. (cplus_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * f-lang.c (f_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * jv-lang.c (java_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * m2-lang.c (m2_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info. * p-lang.c (p_language_arch_info): Set bool_type_symbol and bool_type_default members of struct language_arch_info.
2008-09-11 16:11:40 +02:00
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
return type;
}
}
return ld->arch_info[la->la_language].bool_type_default;
}
struct type *
language_lookup_primitive_type_by_name (const struct language_defn *la,
struct gdbarch *gdbarch,
const char *name)
{
struct language_gdbarch *ld = gdbarch_data (gdbarch,
language_gdbarch_data);
struct type *const *p;
for (p = ld->arch_info[la->la_language].primitive_type_vector;
(*p) != NULL;
p++)
{
if (strcmp (TYPE_NAME (*p), name) == 0)
return (*p);
}
return (NULL);
}
/* Initialize the language routines. */
void
2000-07-30 03:48:28 +02:00
_initialize_language (void)
{
gdb/ Code cleanup: Make 1440 bytes of data segment read-only. * arch-utils.c (endian_enum): Make it const char *const []. * arm-tdep.c (fp_model_strings, arm_abi_strings, arm_mode_strings): Likewise. * breakpoint.c (always_inserted_enums): Likewise. * cli/cli-cmds.c (script_ext_enums): Likewise. * cli/cli-decode.c (add_setshow_enum_cmd, complete_on_enum): Make the enumlist parameter const char *const *. * cli/cli-decode.h (struct cmd_list_element): Make the enums field const char *const *. * command.h (complete_on_enum, add_setshow_enum_cmd): Make the enumlist parameter const char *const *. * cris-tdep.c (cris_modes): Make it const char *const []. * filesystem.c (target_file_system_kinds): Likewise. * i386-tdep.c (valid_flavors, valid_conventions): Likewise. * infrun.c (follow_fork_mode_kind_names, follow_exec_mode_names) (can_use_displaced_stepping_enum, scheduler_enums) (exec_direction_names): Likewise. * language.c (_initialize_language): Make the type_or_range_names and case_sensitive_names variables const char *const []. * mips-tdep.c (mips_abi_strings): Make it const char *const []. * python/python.c (python_excp_enums): Likewise. * remote.c (interrupt_sequence_modes): Likewise. * rs6000-tdep.c (powerpc_vector_strings): Likewise. * serial.c (logbase_enums): Likewise. * sh-tdep.c (sh_cc_enum): Likewise. * stack.c (print_frame_arguments_choices, print_entry_values_choices): Likewise. * symtab.c (multiple_symbols_modes): Likewise. * tui/tui-win.c (tui_border_kind_enums, tui_border_mode_enums): Likewise. * utils.c (internal_problem_modes): Likewise.
2012-01-28 19:08:22 +01:00
static const char *const type_or_range_names[]
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
= { "on", "off", "warn", "auto", NULL };
gdb/ Code cleanup: Make 1440 bytes of data segment read-only. * arch-utils.c (endian_enum): Make it const char *const []. * arm-tdep.c (fp_model_strings, arm_abi_strings, arm_mode_strings): Likewise. * breakpoint.c (always_inserted_enums): Likewise. * cli/cli-cmds.c (script_ext_enums): Likewise. * cli/cli-decode.c (add_setshow_enum_cmd, complete_on_enum): Make the enumlist parameter const char *const *. * cli/cli-decode.h (struct cmd_list_element): Make the enums field const char *const *. * command.h (complete_on_enum, add_setshow_enum_cmd): Make the enumlist parameter const char *const *. * cris-tdep.c (cris_modes): Make it const char *const []. * filesystem.c (target_file_system_kinds): Likewise. * i386-tdep.c (valid_flavors, valid_conventions): Likewise. * infrun.c (follow_fork_mode_kind_names, follow_exec_mode_names) (can_use_displaced_stepping_enum, scheduler_enums) (exec_direction_names): Likewise. * language.c (_initialize_language): Make the type_or_range_names and case_sensitive_names variables const char *const []. * mips-tdep.c (mips_abi_strings): Make it const char *const []. * python/python.c (python_excp_enums): Likewise. * remote.c (interrupt_sequence_modes): Likewise. * rs6000-tdep.c (powerpc_vector_strings): Likewise. * serial.c (logbase_enums): Likewise. * sh-tdep.c (sh_cc_enum): Likewise. * stack.c (print_frame_arguments_choices, print_entry_values_choices): Likewise. * symtab.c (multiple_symbols_modes): Likewise. * tui/tui-win.c (tui_border_kind_enums, tui_border_mode_enums): Likewise. * utils.c (internal_problem_modes): Likewise.
2012-01-28 19:08:22 +01:00
static const char *const case_sensitive_names[]
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
= { "on", "off", "auto", NULL };
1999-07-07 22:19:36 +02:00
language_gdbarch_data
= gdbarch_data_register_post_init (language_gdbarch_post_init);
/* GDB commands for language specific stuff. */
1999-07-07 22:19:36 +02:00
add_prefix_cmd ("check", no_class, set_check,
_("Set the status of the type/range checker."),
1999-07-07 22:19:36 +02:00
&setchecklist, "set check ", 0, &setlist);
add_alias_cmd ("c", "check", no_class, 1, &setlist);
add_alias_cmd ("ch", "check", no_class, 1, &setlist);
add_prefix_cmd ("check", no_class, show_check,
_("Show the status of the type/range checker."),
1999-07-07 22:19:36 +02:00
&showchecklist, "show check ", 0, &showlist);
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
add_setshow_enum_cmd ("type", class_support, type_or_range_names, &type,
_("Set type checking. (on/warn/off/auto)"),
_("Show type checking. (on/warn/off/auto)"),
NULL, set_type_command,
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
show_type_command,
&setchecklist, &showchecklist);
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
add_setshow_enum_cmd ("range", class_support, type_or_range_names,
2011-01-05 Michael Snyder <msnyder@vmware.com> * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-05 23:22:53 +01:00
&range,
_("Set range checking. (on/warn/off/auto)"),
_("Show range checking. (on/warn/off/auto)"),
NULL, set_range_command,
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
show_range_command,
&setchecklist, &showchecklist);
add_setshow_enum_cmd ("case-sensitive", class_support, case_sensitive_names,
&case_sensitive, _("\
Set case sensitivity in name search. (on/off/auto)"), _("\
Show case sensitivity in name search. (on/off/auto)"), _("\
For Fortran the default is off; for other languages the default is on."),
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
set_case_command,
show_case_command,
&setlist, &showlist);
1999-07-07 22:19:36 +02:00
add_language (&auto_language_defn);
2009-08-13 Pedro Alves <pedro@codesourcery.com> PR gdb/8869: * language.c (language, type, range, case_sensitive): Make const. (show_language_command): Don't call deprecated_show_value_hack. Special case "auto". (set_language_command): An unrecognized language is now an internal error instead of a user error. Don't call set_lang_str. (show_type_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_type_command): An unrecognized type is now an internal error instead of a user error. Output type check mismatch with language here. Don't call set_type_str. (show_range_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_range_command): An unrecognized range check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_range_str. (show_case_command): Don't call deprecated_show_value_hack. Special case "auto". Use warning. (set_case_command): Don't call set_case_str. An unrecognized case check is now an internal error instead of a warning. Output range check mismatch with language here. Don't call set_case_str. (set_type_range_case): Don't call set_type_str, set_range_str or set_case_str here. (set_lang_str, set_type_str, set_range_str, set_case_str): Delete. (add_language): Install or reinstall the "set language" command here, and make it an enum command. Build the enumeration and the help string from the current list of known languages. (_initialize_language): Don't install "set language" here. Make "set check type", "set check range" and "set case-sensitive" enum commands. Register the "auto" "local" and "unknown" languages in that order. 2009-08-13 Pedro Alves <pedro@codesourcery.com> * gdb.base/default.exp: Adjust "set language test": it's now an enum command. Larger help string moved to "help set language". * gdb.base/help.exp: Adjust "help set language" expected output, now lists all known languages.
2009-08-13 16:58:27 +02:00
add_language (&local_language_defn);
add_language (&unknown_language_defn);
1999-07-07 22:19:36 +02:00
language = xstrdup ("auto");
type = xstrdup ("auto");
range = xstrdup ("auto");
case_sensitive = xstrdup ("auto");
/* Have the above take effect. */
set_language (language_auto);
}